Local development
Working on RedScribe itself normally means Installation Method 4, so there’s no container rebuild loop between code changes and seeing them run.
- Create and activate a virtualenv, then install Python dependencies:
Terminal window python3 -m venv .venv && source .venv/bin/activatepip install -r requirements.txt - Start just the database (the
dbservice fromdocker-compose.yml, without the rest of the stack):Terminal window docker compose up -d db - Copy the env template and fill in secrets (see Installation → Common
setup),
setting
POSTGRES_HOST=localhost:Terminal window cp .env.example .env - Run migrations, generate a root key, and bootstrap the first Superadmin:
Terminal window python manage.py migratepython manage.py generate_root_key # put the output in .envpython manage.py bootstrap_superadmin --username admin --email admin@example.com - Run the dev server:
Terminal window python manage.py runserver
That’s the whole loop. There’s no docker compose build and no container
restart needed to see a template or view change. Visit
http://localhost:8000/login/.
Day to day
Section titled “Day to day”- Model changes. After editing a model, generate and apply a migration:
CI checks that no migration is missing (
Terminal window python manage.py makemigrationspython manage.py migratemakemigrations --check --dry-runin.github/workflows/test.yml), so commit the generated migration file alongside the model change, in the same PR. - Frontend changes. Touching the Tiptap editor bundle, the password strength meter, or Tailwind classes needs a separate rebuild step. See Frontend asset builds.
- Running tests. See Testing.
Dev vs. prod settings
Section titled “Dev vs. prod settings”.env.example defaults DJANGO_SETTINGS_MODULE to config.settings.dev,
which is literally from .base import * plus DEBUG = True, and nothing
else differs. config.settings.prod layers on top of the same base.py instead:
it hard-requires DJANGO_SECRET_KEY/a root key to already be configured,
refuses to start with DEBUG=True unless you explicitly opt in via
REDSCRIBE_ALLOW_DEBUG_IN_PROD=1, and turns on
SECURE_SSL_REDIRECT/HSTS/secure cookies, trusting X-Forwarded-Proto from
a reverse proxy in front. Local development should always run under dev.
See Configuration
for why running prod without a real proxy in front causes a redirect loop.
What’s next
Section titled “What’s next”- Frontend asset builds
- Testing
- Architecture overview, to orient yourself in the codebase
- Contributing, for expectations before opening a PR