whitelist the ip address django
- In your Django settings.py file, locate the MIDDLEWARE section.
- Add the following code to the bottom of the MIDDLEWARE section:
python MIDDLEWARE = [ # Other middleware classes... 'whitenoise.middleware.WhiteNoiseMiddleware', # Other middleware classes... ]
- Then, in the same settings.py file, locate the ALLOWED_HOSTS list.
- Add your IP address to the ALLOWED_HOSTS list:
python ALLOWED_HOSTS = ['your_ip_address']