I understand circular import error has been asked about a lot but after going through these questions I haven\'t been able to solve my issue. When I try to run my server in Djan
Those habitual with CamelCased names may face the error as well.
urlpatterns
has to be typed exactly as 'urlpatterns'
This will show you error -
urlPatterns = [
path('', views.index, name='index'),
Error -
django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'polls.urls' from '...\\polls\\urls.py'>' 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.
However, fixing the CamelCase will work -
urlpatterns = [
path('', views.index, name='index'),
]
In my case I was getting error because I was giving wrong path of dir containing urls. So I changed this
urlpatterns = [
url(r'^user/', include('core.urls'))
]
to this
urlpatterns = [
url(r'^user/', include('core.urls.api'))
]
After 1 hour search it appears that it's wrong speelling it should be : urlpatterns
urlpatterns = [
path('', views.index, name="index")
]
This error also appears if SomeView doesn't exist in views.py and you do this:
from someapp import views
urlpatterns = [
path('api/someurl/', views.SomeView.as_view(), name="someview"),
]
So make sure all Views you use in urls.py exist in views.py