Answer the question
In order to leave comments, you need to log in
Why is the category page link not working?
Hello! Decided to learn python django. I make a website ad from a book, I rewrite all the instructions and codes from the book. But there is one force-claim that I could not fix. Created a heading ad as it says in the book but the heading link does not work.
When navigating through a category, it says:
Page not found (404)
Request Method: GET
Request URL: 127.0.0.1:8000/bboard/3
Using the URLconf defined in samplesite.urls, Django tried these URL patterns, in this order:
admin/
The current path, bboard/3/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
Answer the question
In order to leave comments, you need to log in
In the urls of the py project, most likely the ursl of your application is not connected.
Let's say you have a project project with a core folder that contains the root urls.
And there is an app app (must be added to installed_apps in settings.py)
This app should have its own urls file that already redirects to your views in the app app.
Then in the root urls (core/urls) you need to add the following
to the imports:
from django.urls import include
in urlpatterns:
path('', include('app.urls')),
After that, you should have urls displayed on the error screen from app
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question