Django - can't open home view

I have the following setup:

FrontEnd folder

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

# Create your views here.
def home_page(request):
    return HttpResponse("New App")


from django.urls import path
from . import views

urlpatterns = [
    path('home/', views.home_page, name='home_page'),

Main Project folder

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

urlpatterns = [
    path('', include('FrontEnd .urls')),

However I can’t open http://localhost:8000.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
November 20, 2023
Accepted Answer


The error you’re encountering is because Django is unable to find a URL pattern that matches the root path (i.e., In your ``Project folder, you’ve included the URLs from your FrontEnd folder under the path '', which means it’s expecting additional path information to match the defined URL patterns.

In your FrontEnd folder, you’ve defined a URL pattern home/, which means the view home_page in your app will respond to, but there’s no URL pattern defined for the root path

To resolve this, you can define a URL pattern in your project’s for the root path. For example:

from django.urls import path, include
from FrontEnd.views import home_page

urlpatterns = [
    path('', FrontEnd.home_page, name='home_page'), 
    path('FrontEnd/', include('FrontEnd.urls')),

This will make the home_page view respond to

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel