Installation
Requirements
Python 3.15 (CI and the Docker image use it too)
Docker, for the local PostgreSQL service
Chromium, once, if you run the browser tests
Local development
bin/setup # dependencies, .env with new secrets, local PostgreSQL, migrations; safe to run again
uv run --env-file .env python src/manage.py createsuperuser
bin/run # app at http://127.0.0.1:8050, MCP server at http://127.0.0.1:8051/mcp
docker-compose.yaml is only the local PostgreSQL, bound to 127.0.0.1:5450 with its data in the Docker volume mampio_postgres. Read database settings from POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, and POSTGRES_PORT. Do not introduce DATABASE_URL. Development settings enable DEBUG, so Django serves static files from src/mampio/static/.
Accounts
People sign up at /accounts/signup/ with their email address and a password, and sign in with their email address. Sign-up sends a confirmation link, and nobody can sign in before confirming. Locally the mail is printed in the runserver terminal. Forgot password? on the sign-in page sends a reset link. The Django admin also signs in with the email address.
The user model is accounts.User: the email address is the login and is unique ignoring case, and there is no username. createsuperuser asks for an email address. An account created with createsuperuser has no confirmed address yet, so confirm it once through the link that the first sign-in sends.
A local database from before 25 November 2026 has the old migration history and the old user table. Drop it and start a fresh one, then run migrate again.
Google sign-in
The “Continue with Google” button appears only when GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET are set. Create an OAuth client of type Web application in the Google Cloud console (APIs & Services → Credentials) and add these authorized redirect URIs:
http://127.0.0.1:8050/accounts/google/login/callback/
https://app.mampio.com/accounts/google/login/callback/
A Google sign-in with an address that already has an account signs in to that account and links Google to it. Otherwise it creates a new, confirmed account.
MCP locally
bin/run starts the MCP server next to the app at http://127.0.0.1:8051/mcp. Create a token with drf_create_token and send it as Authorization: Bearer <token>. See MCP server.
Production
GitHub Actions builds an image on every push to main that changes runtime files:
ghcr.io/diefenbach/mampio:<commit-date>-<short-sha>
The deploy workflow runs iqpp_prod/scripts/deploy.sh on the server. It backs up the database, migrates, collects static files, restarts mampio and mampio-mcp, and checks the site. Only then does it write MAMPIO_IMAGE in the Compose .env; on failure the previous image runs again. See iqpp_prod/docs/deploy.md for the details and the server setup.
Minimum Django environment on the server:
DJANGO_SECRET_KEY=<long-random-value>
DJANGO_ALLOWED_HOSTS=app.mampio.com
DJANGO_CSRF_TRUSTED_ORIGINS=https://app.mampio.com
POSTGRES_DB=mampio
POSTGRES_USER=<user>
POSTGRES_PASSWORD=<password>
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
DJANGO_DEFAULT_FROM_EMAIL=Mampio <noreply@mampio.com>
EMAIL_HOST=<smtp-host>
EMAIL_PORT=587
EMAIL_HOST_USER=<smtp-user>
EMAIL_HOST_PASSWORD=<smtp-password>
EMAIL_USE_TLS=true
# Optional: enables "Continue with Google".
GOOGLE_CLIENT_ID=<client-id>
GOOGLE_CLIENT_SECRET=<client-secret>
Production refuses to start without DJANGO_DEFAULT_FROM_EMAIL and EMAIL_HOST, because sign-up needs confirmation mail. Use EMAIL_USE_SSL=true with EMAIL_USE_TLS=false for port 465.
The deploy script runs migrations and collectstatic. Static files go to a shared Nginx volume at /static/. Production stores them with a content hash in the name (project.storage.HashedStaticFilesStorage, Django’s ManifestStaticFilesStorage that also rewrites ES module imports), so Nginx can let browsers cache /static/ for good and a deploy still reaches every browser at once. A {% static %} path that is not collected makes that page fail with a server error, because hashed names are looked up in the manifest. collectstatic does not read templates, so a test (test_every_static_path_in_the_templates_is_collected) checks every {% static %} path in the templates against the manifest; it requires literal paths so it can see all of them. A CSS url() to a missing file makes collectstatic fail in the CI image probe. Uploaded recipe pictures go to /media/. Do not commit src/staticfiles/ or src/media/.
To roll back, run gh workflow run deploy.yml -R diefenbach/mampio -f tag=<older-tag>.
Logs
Production logs warnings and errors from Django and the app, with traceback, to stderr. Gunicorn writes every request and its own messages to the same stream. Read both on the server with docker logs --since 1h mampio, and the MCP server with docker logs mampio-mcp. Nginx logs every request for all sites to its own container log; each line starts with the host name, so docker logs nginx 2>&1 | grep '^app.mampio.com' shows Mampio. Docker keeps at most 5 × 10 MB per container. iqpp_prod/docs/deploy.md lists the deploy and backup logs.