Simon Au
Simon Au

Reputation: 3

Can't runserver on Django

I just started playing with Django, and I encountered a problem. Here's what it said when I tried to runserver.

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.

Here's what I did.

On setting.py:

INSTALLED_APPS = [
    'Siblog.apps.SiblogConfig',
    'django.contrib.admin',
    'django.contrib.auth',**strong text**
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

Project urls.py:

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

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

Siblog urls.py:

from django.urls import path
from . import views

urlpatterns = [
    path('', views.home, name='Siblog-home'),
]

Siblog views.py:

from django.shortcuts import render

def home(request):
    return render(request, 'Siblog/home.html')

Also the template I've created inside of the Siblog file:

<!DOCTYPE html>
<html>
 <head>
     <title></title>
 </head>
 <body>
     <h1>Siblog Home!</h1>>
 </body>        
</html>   

Upvotes: 0

Views: 1094

Answers (1)

Dave
Dave

Reputation: 612

Simon at quick glance you need to modify a few things.

settings.py

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'Siblog', ]

As long as you properly have the app set in the installed apps section the way you setup the rest of the project seems fine.

Upvotes: 1

Related Questions