Static files and deployment
Collect static assets, configure production settings and deploy safely.
What you will be able to do
- Run collectstatic before deploying.
- Set DEBUG=False in production.
- Serve media and static from a proper server.
- Run migrations in the release step.
In plain English
Development serves static files automatically; production needs collectstatic and a real web server or CDN. Set DEBUG=False, configure ALLOWED_HOSTS, use environment secrets and run migrations as part of the release.
python manage.py collectstatic --noinput
python manage.py migrate --noinput
gunicorn config.wsgi:applicationYour turn
EasyDisable debug
Set DEBUG from an environment variable with a safe default of False.
PYTHON · starter
DEBUG =Check your understanding before moving on.
Knowledge checkQuestion 1
What does collectstatic do?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.