Flask-SqlAlchemy:TypeError:其他参数应命名为<dialectname> _ <argument>,并且为“ nullable”

时间:2019-07-24 01:14:36

标签: python-3.x sqlalchemy flask-sqlalchemy

我正在建立一个博客网站,但我坚持进行数据库初始化。

from flask import Flask
from flask_sqlalchemy import SQLAlchemy


app = Flask(__name__)
app.config['SECRET_KEY'] = 'cbbea94343131d9c386a6335ef5bc2ed'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
db = SQLAlchemy(app)

from Testimonies import routes

这是我收到的错误消息,由于重定向时间很长,我已经收到了一些反馈

arning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in
 the future.  Set it to True or False to suppress this warning.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    from Testimonies import app
  File "/home/me_ajkjq/anaconda3/envs/Testimonies/app/Testimonies/__init__.py", line 10, in <module
>
    from Testimonies import routes
  File "/home/me_ajkjq/anaconda3/envs/Testimonies/app/Testimonies/routes.py", line 4, in <module>
    from Testimonies.models import User, Post
  File 
    "named <dialectname>_<argument>, got '%s'" % k
TypeError: Additional arguments should be named <dialectname>_<argument>, got 'nullable'

0 个答案:

没有答案