does not appear to have any patterns in it. or circular import
Question:
recently i started to studying django but there is a problem into my code and i cant find what exactly could be a decent fix to this problem so i thought i would be good to ask.
…
from django.urls import path
from . import views
ulrpatterns = [
path('' , views.index)
]
…
well this is my code for urls.py into the articles directory.
…
from django.contrib import admin
from django.urls import path , include
from home import views as home_views
urlpatterns = [
path("" ,home_views.index ),
path("about", home_views.about),
path("Contact" ,home_views.contact ),
path('admin/', admin.site.urls),
path('articles/' , include('articles.urls')),
]
…
this one is my main urls.py from what im seeing i called articles.urls but when im running my server it keeps givin me this error
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ” 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.
Answers:
ulrpatterns = [
path('' , views.index)
Django wants to see the urlpatterns
in the urls.py
file. You cannot rename it.
I had the same error when I was doing this crash course Django project. I found at least 50% errors were made by TYPO 😉
from django.urls import path
from . import views
**ulrpatterns** = [
path('' , views.index)
]
change this variable to ‘urlpatterns’, done.
recently i started to studying django but there is a problem into my code and i cant find what exactly could be a decent fix to this problem so i thought i would be good to ask.
…
from django.urls import path
from . import views
ulrpatterns = [
path('' , views.index)
]
…
well this is my code for urls.py into the articles directory.
…
from django.contrib import admin
from django.urls import path , include
from home import views as home_views
urlpatterns = [
path("" ,home_views.index ),
path("about", home_views.about),
path("Contact" ,home_views.contact ),
path('admin/', admin.site.urls),
path('articles/' , include('articles.urls')),
]
…
this one is my main urls.py from what im seeing i called articles.urls but when im running my server it keeps givin me this error
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ” 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.
ulrpatterns = [
path('' , views.index)
Django wants to see the urlpatterns
in the urls.py
file. You cannot rename it.
I had the same error when I was doing this crash course Django project. I found at least 50% errors were made by TYPO 😉
from django.urls import path
from . import views
**ulrpatterns** = [
path('' , views.index)
]
change this variable to ‘urlpatterns’, done.