Forums

manage.py check --deploy gives 1 issue DEBUG set to True

.

(env_adressen) 09:59 ~/adressenproject $ ./manage.py check --deploy 
System check identified some issues:
WARNINGS:
?: (security.W018) You should not have DEBUG set to True in deployment.
System check identified 1 issue (0 silenced).
(env_adressen) 09:59 ~/adressenproject $

[edit by admin: formatting]

If your site is live on the Internet, which it will be if you have deployed it on PythonAnywhere, then yes, you should switch off debug mode. Just have

DEBUG = False

...in your settings.py.

One thing to be aware of is that Django does not serve static files when it is not in debug mode; we have a help page on how to set up static files with Django.

Sorry but the DEBUG = False was set in my settings : see : /home/ulefr01/adressenproject/adressen/settings/base.py and /home/ulefr01/adressenproject/adressen/settings/prod.py

16:03 ~ $ cat /home/ulefr01/adressenproject/adressen/settings/prod.py

from .base import *

DEBUG = False

./manage.py collectstatic (production only)

STATIC_ROOT = 'adressen/static'

secure in production

SESSION_COOKIE_SECURE = True

CSRF_COOKIE_SECURE = True

SECURE_HSTS_SECONDS = 31536000

SECURE_HSTS_INCLUDE_SUBDOMAINS = True

SECURE_HSTS_PRELOAD = True

SECURE_SSL_REDIRECT = True

SECURE_REFERRER_POLICY = 'strict-origin'

SECURE_BROWSER_XSS_FILTER = True

16:04 ~ $

(env_adressen) 09:59 ~/adressenproject $ ./manage.py check --deploy

System check identified some issues:

WARNINGS:

?: (security.W018) You should not have DEBUG set to True in deployment.

System check identified 1 issue (0 silenced).

I see you were asking about this on a separate forum thread too -- check out the suggestion I made there.

thanks, My problem is solved by running first the export command

export DJANGO_SETTINGS_MODULE=something.settings.prod

before the

./manage.py check --deploy thank you for your help