python - Django 错误 - ImportError:无法从“first_project”导入名称“first_app”
问题描述
我是 Django 新手,并开始使用新项目。
我在尝试传递应用程序 URL 时遇到了这个问题。
ImportError:无法从“first_project”导入名称“first_app”(E:\Project\DjangoProject\first_project\first_project_init _.py)
解决方案
You should remove the:
from first_project import first_app
in your first_app/urls.py
. Normally the Python root path is located at the directory that contains the manage.py
file, so there is no module named first_project
.
推荐阅读
- python - 如何使用 scipy.optimize import curve_fit 添加另一条曲线
- react-navigation - 从反应导航中的按钮打开两个抽屉之一 5
- mysql - 如何解决节点js中for循环中的承诺
- entity-framework-6 - 打开 edmx 文件时出现错误“对象引用未设置为对象实例”
- heroku - 通过终端连接 Heroku mLab
- react-native - 启动反应本机应用程序时出现异常
- json - 为什么从请求而不是直接字符串读取时json解析失败
- ios - 使用原生组件在 Flutter 插件中打开 iOS 页面/屏幕
- sql-server-2008 - 怎么办 - SQL 更新方案在多列上使用联接条件,如果为空,则在联接条件中排除列
- javascript - 如何在画布构造函数中将文本放在特定宽度和长度之间