Day-to-day development¶
This page covers the everyday loop: refreshing local state, running the dev server, and finding your
way around the supporting services. It assumes you have already completed the first-time setup with
scripts/dev-setup.sh.
Refreshing local state¶
scripts/dev-setup.sh is idempotent: re-run it whenever you want to refresh migrations, test users,
fake data, or static assets. Environment flags control what it does. The defaults live at the top of
scripts/dev-setup.sh.
Common toggles:
| Flag | Default | Effect |
|---|---|---|
RUN_SERVER=true DJANGO_PORT=8000 |
true |
Start the dev server when the script finishes |
PRETALX_SYNC=true |
false |
Import real talks from Pretalx (needs an API token) |
IMPORT_STREAMS=true |
false |
Import livestream URLs from Google Sheets |
GEN_FAKE_DATA=true |
true |
Generate sample events and fake talks |
GEN_TEST_USERS=true |
true |
Create the dev login users |
NO_AVATARS=true |
false |
Skip avatar downloads during Pretalx import |
DOWNLOAD_FONT=false |
true |
Skip the Noto font download |
SKIP_STEPS="collectstatic" |
empty | Skip individual steps by name (deps, tailwind, mailpit, django, collectstatic) |
The script creates these dev users (the passwordless login codes land in Mailpit at http://localhost:8025):
user1@example.com/user2@example.com- passwordless loginmod@example.com- staff moderator, also passwordlessadmin@example.com/admin- superuser with password login
Test with a production backup¶
You can run the dev server against a copy of the production database. The script restores a plain
SQL pg_dump file into a local Postgres 18 container, and the server then uses that container
instead of db.sqlite3. Docker must be running.
The script does these steps:
- It removes the container
conference-portal-dev-dbif it exists, and starts a new one on127.0.0.1:5433. - It restores the dump into the new container.
- It runs the migrations, so that the database matches your branch.
- It creates the dev users from the list below, if
GEN_TEST_USERS=true.
Fake data is off by default in this mode, so that it does not mix with the real talks. To start the
server again later without a new restore, run DEV_POSTGRES=true scripts/dev-setup.sh. Set
DEV_DB_PORT if port 5433 is in use.
Real attendee data
Keep the container and the dump on your machine. The dump does not contain the media files, so talk
images and avatars are missing. Login emails go to Mailpit, but an event with a validation_api_url
still sends the email address of each login attempt to that ticket API.
Clean slate
For a truly fresh start, wipe everything that is not checked in but keep the virtualenv and the Pretalx API cache (both are slow to rebuild):
Running the dev server¶
The setup script starts the server for you when RUN_SERVER=true (the default). To start it
manually later:
The app is then available at http://localhost:8000.
Tailwind watcher¶
The setup script downloads a standalone tailwindcss binary into .venv/bin/. By default it builds
static/css/tailwind.min.css once, minified. When you are editing templates and want CSS rebuilt on
every change, run the script with DEBUG=true so it starts a watcher instead:
Or run the watcher directly:
Mailpit (local email)¶
All outgoing email in development goes to Mailpit, which the setup script downloads and starts automatically. This is where you read the passwordless login codes.
- Web UI: http://localhost:8025
- SMTP:
127.0.0.1:1026(port 1026 instead of the usual 1025, to avoid clashing with apps like Proton Mail Bridge that occupy 1025)
Override MAILPIT_SMTP_PORT / MAILPIT_UI_PORT in the environment if those ports are taken. The
script exports matching EMAIL_HOST / EMAIL_PORT values so Django talks to the right port without
touching the committed django-vars.env.
Logs¶
Logging is configured in event_talks/settings.py. Files go to the directory named by
DJANGO_LOGS_DIR (default: logs/ in the project root; created automatically):
django.log- everything, as JSON, rotated daily, 30 days kepterror.log- errors only, rotated daily, 90 days keptauth.log- authentication events, rotated daily, 90 days kept
The console handler prints colored, human-readable output, so during development you usually just
watch the runserver terminal.
Management commands¶
Custom commands live in talks/management/commands/ and users/management/commands/:
import_pretalx_talks- sync talks, speakers, and rooms from Pretalximport_livestream_urls- import livestream URLs from Google Sheetsupdate_video_links- update recorded-video links from Vimeoupdate_youtube_links- update recorded-video links from a Pretalx code to YouTube ID JSON mapgenerate_fake_talks- generate fake talks for developmentcreateuser- create a passwordless user
All data importers support --dry-run. Run any command with --help for the full argument list.
See Management commands for the full reference.
Where to go next¶
- Full stack in Docker - production-like testing with Postgres
- Testing - pytest, coverage, property-based tests
- Code quality - linting, type checking, pre-commit hooks, SonarQube
- Documentation - working on this docs site