在windows环境下报错,运行命令set ops_config=local && python manage.py runserver
来源:4-9 打造高可用flask mvc框架
慕神2414411
2021-04-01
在windows环境下报错,运行命令set ops_config=local && python manage.py runserver
报错Traceback (most recent call last):
File “E:\Study\manage.py”, line 2, in
from application import app,manager
File “E:\Study\application.py”, line 16, in
app = Application( name )
File “E:\Study\application.py”, line 11, in init
self.config.from_pyfile( ‘config/%s_setting.py’%os.environ[‘ops_config’] )
File “C:\Users\李瑞鹏\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\config.py”, line 131, in from_pyfile
with open(filename, mode=“rb”) as config_file:
FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): ‘E:\Study\config/local _setting.py’
刚开始以为是我自己写错了,用下载的代码也是这个报错。求老师解答一下,谢谢
2回答
-
慕前端1102380
2022-02-19
&&左边不要加空格,不然就当成是local _setting.py’,而不是local_setting.py’了(前者下划线左边有空格)
132022-03-20 -
编程浪子
2021-04-01
你好
你没有 E:\Study\config/local _setting.py 这个配置文件,你根据demo自己写个
可以加我: 1586538192
012021-12-15
相似问题