404 and 500 Customisation - Django
Simple 3 Steps
- add a folder
templates
under the root folder of your project; ideally it should be the same directory as yourmanage.py
file - create
404.html
and500.html
files intemplates
folder and customize however you please - go to
settings.py
change one little thing: ```pythonassuming you haven’t changed your BASE_DIR
this is the default:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
TEMPLATES = [{ ‘DIRS’: [os.path.join(BASE_DIR, ‘templates’)], }] ``` You have to make sure that the correct html files can be properly referred to. And that’s is!!