views.py
def page_not_found_view(request, exception):
return render(request, 'app/404.html', status=404)
urls.py in main project folder
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('users.urls')),
path('',include('app.urls')),
]
handler404 = "yournameapp.views.page_not_found_view"
settings.py
import os
DEBUG = False
TEMPLATES = [
{
'BACKEND':
'DIRS': [os.path.join(BASE_DIR, 'templates')],
],
},
},
]
Top comments (0)