D
D
Daler Abdurahimov2020-05-14 11:32:51
Django
Daler Abdurahimov, 2020-05-14 11:32:51

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.
5ebd01f6cbab2376333259.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bubaley, 2020-05-14
@bubaley

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

S
Seo5, 2021-05-28
@Seo5

There is a question in url processing usually https://saitsozdanie.ru/forum/index.php?topic=8932.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question