django报错The included URLconf does not appear to have any patterns in it.
django.core.exceptions.ImproperlyConfigured: The included URLconf 'testDjango.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.工程架构:
setting.py中配置
主程序testDjango/testDjango/urls.py中路由配置:
应用testDjango/App/urls.py中路由配置:
views.py内容:
执行程序报错:
django.core.exceptions.ImproperlyConfigured: The included URLconf 'testDjango.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
主程序testDjango/testDjango/urls.py中路由配置 ,用path,在加上namespace,试试。 qqq911 发表于 2021-2-5 11:41
主程序testDjango/testDjango/urls.py中路由配置 ,用path,在加上namespace,试试。
试过了,还是同样报错
path('app/', include('app.urls',namespace='app')), 问题已经解决,是我之前不小心将主程序testDjango/testDjango/urls.py,这个urls.py手工删除掉了,然后自己又手工建了这个文件,后来我重新将整个项目删除掉,重新创建django项目,就好了,具体不清楚什么原因。 解决了就好 赞 学习了。 ;P
页:
[1]