1

In my Django project's settings.py for deployment i want mywebsite.com to be the allowed hosts but putting it so throws the 500 error.

For production server when i use:

ALLOWED_HOSTS = ['localhost', 'mywebsite.com'] It throws error 500 on every page.

But if i change it to

ALLOWED_HOSTS = ['*'] It works fine.

I checked error.log of nginx but there is not error logged.

But i guess its not safe to keep * and i just want to keep mywebsite.com or www.mywebsite.com

Please suggest why its throwing 500 error.

Thanks

uday.blob
  • 349
  • 3
  • 6
  • 14

1 Answers1

1

Probably a duplicate of Allowed Host Setting for Django on EC2 where I can find the answer working fine (as they have accepted it). Please try it like and check if this works.

ALLOWED_HOSTS = ['.mywebsite.com']
Community
  • 1
  • 1
MaNKuR
  • 2,578
  • 1
  • 19
  • 31