class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:" + json_dict['MAIL_PASSWORD'] + "@localhost:3306/robot"
class TestingConfig(Config):
pass
class ProductionConfig(Config):
pass
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}
用flask框架开发软件,按照《FLASK Web开发》中的介绍。在config
文件中设置了DEBUG=True
。当时使用flask run
命令启动flask程序时,DEBUG mode没有启动。
* Serving Flask app "manage.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
查了很多的资料都不明白为什么DEBUG=True
不起作用。
对这个问题解释得比较好的是
flask Config File 'Debug=True' Do Nothing
因为Flask 1.0.2建议使用的是flask run
了.
但觉得配置文件config
上关于develop与测试环境的设置就没有什么用了。
但是不用flask run
命令用回以前的python run.py runserver
还是能够启动debug mode的
网友评论