0

I am trying to simply put a 'Hello World' text on the server. And it brings an error.

Project Urls.py :

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

App Urls.py

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

Views.py

from django.shortcuts import render from django.http import HttpResponse def index(response): return HttpResponse('<h1>Hello World</h1>') 

The Error it tells me: The included URLconf in myapp/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.

0

1 Answer 1

1

You are missing an 's' in your apps urls.py. it has to be 'urlpatterns', instead of 'urlpattern'

urlpatterns = [ path('', views.index,name = 'index') ] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.