Video coming soon

The recording for this lesson has not been published yet.

What we cover

  • What you already have: Post model, function views, templates, admin, PaaS deployment
  • What a 'real' Django project adds on top of that
  • Course roadmap module by module
  • How to work through the lessons and exercises

Lesson notes

1. An honest inventory of what you built

The Django Girls tutorial ends with a working, published website. That is a real achievement, and this course starts by taking it seriously. Before we add anything, let us name every piece of it - because from now on we will only ever talk about the parts that are missing.

PieceWhat you wroteWhat it does
Project package mysite/settings.py, mysite/urls.py One settings file with DEBUG, SECRET_KEY and SQLite, plus a single URL table
One app blog/ Everything else lives here: model, views, forms, templates
One model Post author, title, text, created_date, published_date and a publish() method
Function views post_list, post_detail, post_new, post_edit A queryset, a render() call and a redirect()
Templates base.html plus three page templates Template inheritance and Bootstrap from a CDN
One form PostForm(ModelForm) Create and edit a post from the site itself
Admin admin.site.register(Post) A free CRUD interface and a superuser
Deployment PythonAnywhere + git A public URL, a pulled repository and a "Reload" button

That is roughly 300 lines of your own code. Everything in this course is built on top of it, so none of it was wasted.

2. What a real project adds on top of that

The tutorial optimises for one thing: getting you to a published page in a day. To do that it postpones almost everything a production project needs. Here is the honest list.

  • Configuration. Your SECRET_KEY is in git and DEBUG = True sits next to ALLOWED_HOSTS. There is no separation between your laptop and the server.
  • Data modelling. One model, no relations worth the name, no indexes, no Meta.ordering, no custom manager, and every page runs whatever queries the template happens to trigger.
  • Views. Four functions that repeat the same fetch-or-404 dance. No pagination, no permission checks, no reusable mixins.
  • Users. Only the superuser can do anything, and only through the admin. There is no sign-up, no login page of your own, no profile, no permissions.
  • Forms and content. One ModelForm, no validation of your own, no file uploads, no protection against spam.
  • Tests. None. You verify the site by clicking on it.
  • Performance. No caching, no query counting, no idea what happens with 10,000 posts.
  • Operations. Deployment is a manual pull and a reload. There is no CI, no static file pipeline of your own, no logging, no backups, and SQLite is doing a job it was not designed for.

3. The road ahead

The course grows the same blog step by step. Each stage assumes the one before it, which is why the modules are numbered rather than optional.

Tutorial blog where you are now Modules 0-1 structure, settings, git Modules 2-3 ORM, class-based views Modules 4-7 users, forms, frontend, SEO Modules 8-11 tests, cache, Celery, API Modules 12-14 async, security, your server Module 15 capstone project one blog that keeps growing
  1. Module 0 - Starting line. The starter repository and a git workflow.
  2. Module 1 - From tutorial project to a real project. Several apps, secrets out of settings, split settings, automated code style.
  3. Module 2 - Models and the ORM in depth. Categories, tags, comments, migrations, querysets and query counting.
  4. Module 3 - Class-based views. Your four functions become ListView, DetailView, CreateView and UpdateView.
  5. Modules 4-5 - Users and content. Registration, login, permissions, real forms and uploads.
  6. Modules 6-7 - Templates, frontend, search and feeds.
  7. Modules 8-11 - Quality and scale. pytest, CI, caching, Celery, a REST API.
  8. Modules 12-14 - Async, security and your own server. Docker, Nginx, Gunicorn, PostgreSQL.
  9. Module 15 - Capstone. You build a project of your own with everything above.

4. What will not be repeated

Assumed knowledge, never re-taught: what a model, a view, a template and a URL pattern are; how makemigrations and migrate relate; how to start a server and read a traceback; the basics of the admin; and the fact that a {% for %} loop in a template is not Python.

Deliberately re-taught, because the tutorial version was a simplification: settings, deployment, forms, git, and everything about the database beyond one table.

5. How to work through the lessons

Every lesson has the same shape: notes to read, code to type, and an exercise at the end. The exercise is the lesson. Reading the notes gives you the vocabulary; doing the exercise gives you the skill.

  • Type the code, do not paste it. Typing is slow enough that you notice what you do not understand.
  • Work on a branch per lesson. git switch -c lesson/1-2-secrets. Lesson 0.3 explains why.
  • Break things on purpose. Misspell a setting, remove a migration, and read the error. Recognising error messages is half of Django.
  • Keep the official docs open. This course teaches you which page of docs.djangoproject.com to open, not how to avoid it.
  • Do not skip ahead to Celery. Every module leans on the previous one; the interesting modules are the hardest to bolt on later.

6. Exercise

  1. Open your tutorial project and write down, in one file, every model field, every view and every template it contains. Compare your list with the table in section 1.
  2. Find SECRET_KEY in your settings.py and confirm it is in your git history (git log -p -- mysite/settings.py). Do not fix it yet - that is lesson 1.2.
  3. Count the SQL queries your post list page makes. If you have no idea how, note the question down: module 2 answers it.
  4. Write three sentences about what you want to build after this course. Module 15 will ask you for them.

Further reading

After this lesson you will

  • Name every piece of the app you built in the tutorial
  • Understand the roadmap of this course
  • Know what will and what will not be repeated here