samedi 20 mars 2021

How do I fix "improperlyconfigured" error?

Just started learning Django but met with an error right off the bat

I got the error:

django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'app.urls' from 
'C:\\django tutorial\\mysite\\app\\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.

these are the files that have my code in it:

views.py:

from django.shortcuts import render 
from django.http import HttpResponse

def index(response):
 return HttpResponse('Tech with Adil')

app.urls.py:

from django.urls import path from . import views 
urlpatters = [
     path("", views.index, name='index') ]

and mysite.urls.py:

from django.contrib import admin

from django.urls import path, include 

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



Aucun commentaire:

Enregistrer un commentaire