Django doesn't recognize DEBUG = False
Find the DJANGO_SETTINGS_MODULE environment variable within your project.
The value of it is in python path syntax. Use it to locate the settings file since it is the one getting used by django and make sure that DEBUG = False. Additionally you could add a print statement which gives some visual feedback on server start.
Restart your development server after you have saved the configuration by executing python manage.py runserver.
I'm trying to develop 404 and 500 error custom templates for my Django project.
When I change DEBUG to False, Django always returns me:

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

After change ALLOWED_HOSTS to ['.domain.com', 'www.domain.com'] I obtain:

Invalid HTTP_HOST header: 'domain.com'. You may need to add u'domain.com' to ALLOWED_HOSTS.

What am I doing wrong? Why Django does not recognize the variable?