H
H
howuu2019-03-05 18:41:43
Django
howuu, 2019-03-05 18:41:43

Weirdness with Django 404 page?

I decided to create a custom page for errors in Django
in the settings I wrote

DEBUG = False
ALLOWED_HOSTS = ["127.0.0.1"]

In the main urls (there is also a separate blog application, with its own urls, it also stores templates and statics for 404 pages, as well as a view that displays all this)
from django.conf.urls import handler400, handler403, handler404, handler500

and under urlpatterns I wrote this
handler400 = 'blog.views.page_not_found'
handler403 = 'blog.views.page_not_found'
handler404 = 'blog.views.page_not_found'
handler500 = 'blog.views.page_not_found'

well and such views
def page_not_found(request):
  return render(request, '404.html')

The strange thing is that
in my error page (which is displayed the same for all errors), bootstrap styles and a picture are connected,
I added the picture to the project a day ago, but the joke is that django sees and displays only old files, for example, bootstrap was from the very beginning and it connects or if I display the old images too, anything I add to the images or styles folder is not displayed and django does not see it, although it is there, what the hell? But if you connect something external, load a picture from the Internet, then everything is OK

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-03-05
@sergey-gornostaev

Browser cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question