-1
私は次のスクリプトがあります。その後、フラスコアプリケーションでsqlite3データベースを作成できませんか?
#!flask/bin/python
import os
from flask import Flask, render_template, request, url_for
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask("hello")
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.sqlite3')
print SQLALCHEMY_DATABASE_URI
db = SQLAlchemy(app)
db.create_all()
print db
しかし、私は実際にスクリプトを実行したとき、私は何を見ていないです:
$ python db_create.py
sqlite:////home/ubuntu/Paw/paw/app.sqlite3
/home/ubuntu/.virtualenvs/paw-py/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning.
warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning.')
<SQLAlchemy engine='sqlite://'>
、なぜ私はSQLAlchemyのエンジンは、メモリ内に配置されて見ていましたか?
私の許可は間違っていないようです。