How to fix the error for django 'django.core.exceptions.ImproperlyConfigured' with urls?

Manas Sanas
from django.contrib import admin
from django.urls import path, include


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

There is an error when i add url to url.py.

when i run the code in terminal : 'python manage.py runserver' ; then the follwing error is displayed in the terminal -

django.core.exceptions.ImproperlyConfigured: The included URLconf 
'<module 'polls.urls' from 


'C:\\Users\\Administrator\\PycharmProjects\\website2\\mysite\\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.

I searched everywhere for the solution but i couldn't find it. Please help me to get out of it.

Manas Sanas

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')),
]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Django Installed app and ImproperlyConfigured Error: django.core.exceptions.ImproperlyConfigured

django.core.exceptions.ImproperlyConfigured

Django.core.exceptions.ImproperlyConfigured:

Python | Docker | Django | django.core.exceptions.ImproperlyConfigured Error

how to fix the 'django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library'

Issue in django.core.exceptions.ImproperlyConfigured

Django Error: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module

Django Celery scheduled task django.core.exceptions.ImproperlyConfigured

django.core.exceptions.ImproperlyConfigured: Django 3.0.1 is not supported

Django channels pytest testing. django.core.exceptions.ImproperlyConfigured. .

How to resolve "django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: foo" in Django 1.7?

Django.core.exceptions.ImproperlyConfigured: Error running functional_tests.py

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Error message: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty

django.core.exceptions.ImproperlyConfigured: WSGI application 'DjBlog.wsgi.application' could not be loaded; Error importing module

Why do I keep getting django.core.exceptions.ImproperlyConfigured: Specifying a namespace although I added app name in urls.py

django.core.exceptions.ImproperlyConfigured: Field name `id` is not valid for model

django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG

django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library

"django.core.exceptions.ImproperlyConfigured:" while doing migrations to posgreSQL

django error: django.urls.exceptions.NoReverseMatch

Error in deploying Django app on Google cloud using appengine "django.core.exceptions.ImproperlyConfigured: Set the SECRET_KEY environment variable"

How can I solve the ImproperlyConfigured error in Django

django.core.exceptions.ImproperlyConfigured: WSGI application '{project_name}.wsgi.application' could not be loaded; Error importing module

How do I solve "django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library" when running PyCharm test?

django.core.exceptions.ImproperlyConfigured: Enable 'django.contrib.auth.context_processors.auth'

"Apps aren't loaded yet" and "django.core.exceptions.ImproperlyConfigured" in Django?