Python ';SQLALCHEMY_数据库_URI';运行Flask应用程序时不在app.config中出错
尝试运行Flask应用程序时,我遇到以下与sqlalchemy相关的错误:Python ';SQLALCHEMY_数据库_URI';运行Flask应用程序时不在app.config中出错,python,flask,flask-sqlalchemy,Python,Flask,Flask Sqlalchemy,尝试运行Flask应用程序时,我遇到以下与sqlalchemy相关的错误: 'SQLALCHEMY_DATABASE_URI' not in app.config and AttributeError: module 'auth_.server' has no attribute 'config' Flask应用程序的我的目录结构: parent dir - index.py auth_ - server.py server.py的内容 from flask import Flask
'SQLALCHEMY_DATABASE_URI' not in app.config and
AttributeError: module 'auth_.server' has no attribute 'config'
Flask应用程序的我的目录结构:
parent dir
- index.py
auth_
- server.py
server.py的内容
from flask import Flask
server = Flask(__name__,instance_relative_config=False)
server.config['SECRET_KEY'] = 'xxxxxxxxx'
server.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
server.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False