Reputation: 1
I keep getting this error:
personal_portfolio.urls
, Django tried these URL patterns, in this order:admin/
home/
The current path, home, didn't match any of these.
This is my urls.py
for the overall project
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('home/', include('hello_world.urls')),
]
this is my code for hello_world urls.py
from django.urls import path
from hello_world import views
urlpatterns = [
path('home/', views.hello_world, name='hello_world'),
]
this is my code for hello_world
views.py
from django.shortcuts import render
def hello_world(request):
return render(request, 'hello_world.html')
Upvotes: 0
Views: 2507
Reputation: 27513
you need to change this url from
urlpatterns = [
path('home/', views.hello_world, name='hello_world'),
]
to
urlpatterns = [
path('', views.hello_world, name='hello_world'),
]
to get to http://127.0.0.1:8000/home/
else you need to goto http://127.0.0.1:8000/home/home/
for the current url
Upvotes: 1