The recording for this lesson has not been published yet.
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.
| Piece | What you wrote | What 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.
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.
SECRET_KEY is in git and
DEBUG = True sits next to ALLOWED_HOSTS. There is no separation
between your laptop and the server.Meta.ordering, no custom manager, and every page runs whatever queries the
template happens to trigger.ModelForm, no validation of your
own, no file uploads, no protection against spam.A first tutorial that taught all of the above would take three weeks and nobody would finish it. The tutorial made the right trade-off. This course pays the deferred cost.
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.
ListView, DetailView, CreateView and
UpdateView.
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.
Redo the relevant chapter of the tutorial first. An afternoon spent there is cheaper than fighting module 2 with a vague idea of what a migration is.
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.
git switch -c lesson/1-2-secrets.
Lesson 0.3 explains why.docs.djangoproject.com to open, not how to avoid it.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.