Written walkthrough — read the full lesson below

10 minFree preview

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

  1. Configuration and secrets. A hardcoded DEBUG = True or a secret committed to git is a breach waiting to be found.
  2. Static and media files. runserver serves them for you. Nothing else does.
  3. The database. Connections, indexes, migrations and backups all behave differently with real load and real data.
  4. Process management. Who restarts gunicorn at 3am? What happens when a worker runs out of memory?
  5. 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 runserver in production. It is a development server with no hardening, no concurrency and a warning telling you exactly that.
  • Never run with DEBUG = True in 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

  1. Fill in the baseline inventory. If you cannot answer a line, that gap is your first task.
  2. Write down the three things you are most afraid of breaking in production.
  3. Check that DEBUG is False in your production settings, and that you are not running runserver.
  4. Create a runbook file 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.

Sign in & enroll to track progress.