whitelist the ip address django

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