无法创建应用

来源:6-2 django目录结构解析-2

一步一个堪

2021-04-13

“C:\Program Files\JetBrains\PyCharm 2020.3.4\bin\runnerw64.exe” D:\PyProjectVritualenv\mxonline\Scripts\python.exe D:/PycharmProjects/djangoProject/message/manage.py runserver 8000
Traceback (most recent call last):
File “D:/PycharmProjects/djangoProject/message/manage.py”, line 21, in
main()
File “D:/PycharmProjects/djangoProject/message/manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “D:\PyProjectVritualenv\mxonline\lib\site-packages\django\core\management_init_.py”, line 381, in execute_from_command_line
utility.execute()
File “D:\PyProjectVritualenv\mxonline\lib\site-packages\django\core\management_init_.py”, line 325, in execute
settings.INSTALLED_APPS
File “D:\PyProjectVritualenv\mxonline\lib\site-packages\django\conf_init_.py”, line 79, in getattr
self.setup(name)
File "D:\PyProjectVritualenv\mxonline\lib\site-packages\django\conf_init
.py", line 66, in setup
self.wrapped = Settings(settings_module)
File "D:\PyProjectVritualenv\mxonline\lib\site-packages\django\conf_init
.py", line 157, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "c:\users\arik\appdata\local\programs\python\python37\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “

写回答

1回答

一步一个堪

提问者

2021-04-13

好奇怪,不同的建立流程,有的没错,有的就需要改

'DIRS': [BASE_DIR + '/templates']

困惑,有的需要改,有的不需要改

0
2
weixin_慕用0423436
修改方法: 'DIRS': [str.format(BASE_DIR, '/templates')],再次运行就成功了。
2021-04-29
共2条回复

Django+ xadmin 开发在线教育网站

一套通用的技术组合拳,助你解决大部分Python类网站后端问题

1911 学习 · 2149 问题

查看课程