[英]Flask-SQLAlchemy. AttributeError: module '<…>.db' has no attribute 'Model'
so I have one module called 'co'. 所以我有一个名为“ co”的模块
Here is it's __init__.py 这是__init__.py
...
db = SQLAlchemy(app)
...
And models.py 和models.py
...
from co import db
class BaseModel(db.Model):
id = db.Column(db.Integer, primary_key=True)
...
Running flask db init
is giving me 运行flask db init
给了我
AttributeError: module 'co.db' has no attribute 'Model' AttributeError:模块“ co.db”没有属性“ Model”
What am I doing wrong here? 我在这里做错了什么?
This would imply you have the following folder structure 这意味着您具有以下文件夹结构
root
- co
- __init__.py
- models.py
- routes.py
- myapp.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.