` # **views.py**
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return HttpResponse('<h1>Blog home</h1>')
def about(request):
return HttpResponse('<h1>Blog About</h1>')
# **urls.py (in blog)**
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='blog-home'),
path('about/', views.about, name='blog-about'),
]
# **urls.py (in django_project)**
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('blog/', include('blog.urls')),
]
can’t get the aboutpage
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/blog/about
Using the URLconf defined in django_project.urls, Django tried these URL patterns, in this order:
admin/
blog/ [name=’blog-home’]
The current path, blog/about, didn’t match any of these.
trying to get the about page but couln’t found
resulted:Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/blog/about
Using the URLconf defined in django_project.urls, Django tried these URL patterns, in this order:
admin/
blog/ [name=’blog-home’]
The current path, blog/about, didn’t match any of these.
Pandey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.