Course Introduction: From Dev Server to Production
Course Introduction: From Dev Server to Production
On your laptop you are the only user, the data does not matter, and a restart costs nothing. Production is the opposite of all three, and the gap between them is where almost every outage lives.
The five things that break when you leave your laptop
- Configuration and secrets. A hardcoded
DEBUG = Trueor a secret committed to git is a breach waiting to be found. - Static and media files.
runserverserves them for you. Nothing else does. - The database. Connections, indexes, migrations and backups all behave differently with real load and real data.
- Process management. Who restarts gunicorn at 3am? What happens when a worker runs out of memory?
- Visibility. With no logs, metrics or error tracking you cannot tell a slow page from a broken one.
Every lesson in this course takes one of those, shows the failure it causes, gives you the fix, and leaves you a checklist item.
How to work through it
Each lesson is short and ends with a workbook and a task to do in your own project. Do the task before moving on: a deployment you understand beats a deployment you copied.
The sample project we use throughout is a small bookmarks app — Postgres, gunicorn, Nginx, and a single container host or VPS. Nothing in this course depends on that shape: the same steps apply on Render, Fly, Heroku-style platforms or your own box.
The two rules before anything else
- Never run
manage.py runserverin production. It is a development server with no hardening, no concurrency and a warning telling you exactly that. - Never run with
DEBUG = Truein production. It leaks settings, source paths and SQL, and it turns your error pages into documentation for an attacker.
Workbook
Baseline inventory — write these down before you change anything:
- Python and Django versions running in production:
- Database engine, version, and whether it is managed:
- Where the app runs, and how you deploy to it:
- Where secrets live today (and who can read them):
- Who has SSH or dashboard access:
- Where would you look right now if the site went down:
Your Version
- Fill in the baseline inventory. If you cannot answer a line, that gap is your first task.
- Write down the three things you are most afraid of breaking in production.
- Check that
DEBUGisFalsein your production settings, and that you are not runningrunserver. - Create a
runbookfile in your repo. Every lesson from here adds to it.
Keep up with new lessons
Leave your email and we’ll send each new free lesson and the case study behind it.
Your notes
Sign in to write notes on this lesson and review them from your dashboard.