0
新的Python的世界,被推薦去嘗試cookiecutter-flask而是撞到一個問題:瓶18.11機型不產生遷移
我產生遷移「手動」而不是讓它基於模型。在我意識到可以使用模型來生成遷移(如使用cookiecutter進行「庫存」)之後,我刪除了手動遷移,但似乎無法使模型生成遷移文件。
在app.py
from project import commands, public, user, category
def register_blueprints(app):
"""Register Flask blueprints."""
app.register_blueprint(public.views.blueprint)
app.register_blueprint(user.views.blueprint)
app.register_blueprint(category.views.blueprint) <- my model
return None
在
blueprint = Blueprint('category', __name__, url_prefix='/categories', static_folder='../static')
我的路線會的意見進行檢測
#flask urls
/categories/ category.categories
/categories/static/<path:filename> category.static
但是當我運行
#flask db migrate
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.autogenerate.compare] Detected added table 'users'
INFO [alembic.autogenerate.compare] Detected added table 'roles'
它似乎無法檢測類別模型,而我失去了我在這裏失蹤的內容?