This command helps you find security issues in your Django project before you make it live. It checks important settings to keep your site safe.
Security checklist (manage.py check --deploy) in Django
python manage.py check --deploy
This command runs a set of security checks on your Django project.
It only checks settings related to deployment security, not your app logic.
python manage.py check --deploy
python manage.py check
This example shows how the command warns you if DEBUG is True, which should be False in production. Fixing this removes the warning.
1. Create a Django project named 'mysite'. 2. Open settings.py and set DEBUG = True. 3. Run: python manage.py check --deploy # Output will warn about DEBUG being True, which is unsafe for deployment. 4. Change DEBUG = False in settings.py. 5. Run: python manage.py check --deploy # Output will show no errors if other security settings are correct.
The command checks settings like DEBUG, SECRET_KEY, ALLOWED_HOSTS, SSL/HTTPS settings, and more.
Time complexity is minimal since it only reads settings and runs simple checks.
Common mistake: ignoring warnings and deploying with DEBUG = True or missing ALLOWED_HOSTS.
Use this command before deployment to catch security risks early.
Use manage.py check --deploy to find security issues before going live.
It helps ensure your Django settings are safe for production.
Fix warnings it shows to protect your site from common security problems.