I would like to show an 404 error if there’s no proper entry in project_name/urls.py.
I read Writing your first Django app but i don’t understood how to create a general error – not only for an app.
So i tried this:
TEMPLATE_DIRS = /var/www/first/templates- echo “404 ERROR” > /var/www/first/templates/404.html
-
in
/var/www/first/urls.py:from django.http import Http404 try: ... url(r'^admin/', include(admin.site.urls)), ... except: raise Http404
After all i still get a 500 error if i call an unknown url.
It works with following in
/var/www/first/urls.py