Skip to content Skip to sidebar Skip to footer

How To Fix The Error For Django 'django.core.exceptions.improperlyconfigured' With Urls?

from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('polls/', include('polls.urls')), ] There is

Solution 1:

I think this error most of u misunderstand, circular error imports are very rare in django only in flask it is frequent .

This error is caused by mispelling 'urlpatterns' in the urls.py which has been created in a django app.

Also it can be caused by not defining it in your urlpatterns in the urls.py file

Probably the error is caused by one of the above.

Its that easy

Solution 2:

This error might be coming because of the adimn in urls.py

urlpatterns = [
    path('admin/', admin.site.urls),
    path('polls/', include('polls.urls')),
]

When the polls path was removed by me, the website was running properly. So try comment the polls path in urls

urlpatterns = [
    path('admin/', admin.site.urls),
    #path('polls/', include('polls.urls')),
]

Solution 3:

make sure in your polls app, you have a file called urls.py, which should look something like this:

from django.urlsimport path
from . import views

urlpatterns = [
    path('', views.your_view),
]

If you haven't configured the views.py page in your polls app, then you can leave urlpatterns blank for now and you shouldn't see any errors.

Post a Comment for "How To Fix The Error For Django 'django.core.exceptions.improperlyconfigured' With Urls?"