so I have one module called 'co'.
Here is it's __init__.py
...
db = SQLAlchemy(app)
...
And 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
AttributeError: module 'co.db' has no attribute '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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.