3👍
✅
You need just prepare 404.html
template and set DEBUG=False
in your settings.py
0👍
Or if you want a custom 404 page, you just need to set the 404 handler adding in your main urls.py :
handler404 = 'mysite.views.my_custom_404_view'
https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views
- [Django]-Django Invalid HTTP_HOST header: 'mydomain'. You may need to add u'mydomain' to ALLOWED_HOSTS
- [Django]-Django: paginating differently on the first page
- [Django]-Using Django-Q in production
0👍
Create a 404.html file in your template folder
add this code to your view
from django.shortcuts import render def handler404(request): return render(request, ’404.html’)
and in urls.py
handler404 = ‘mysite.views.handler404′
- [Django]-TypeError: unhashable type: 'dict' Django
- [Django]-CORS vs JWT what is difference
- [Django]-Why do we write [0] after get_or_create in model_name.object.get_or_create() in django
Source:stackexchange.com