Local development
Running RedScribe locally without a Docker rebuild cycle, and the day-to-day dev loop.
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 → Before
you start),
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:
There’s no CI to catch a missing migration for you, so run
Terminal window python manage.py makemigrationspython manage.py migratemakemigrations --check --dry-runyourself (see Testing) and commit the generated migration file alongside the model change, in the same commit. - 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 a root key (and
DJANGO_SECRET_KEY) to already be configured before the app will start. - Refuses to start with
DEBUG=Trueunless you explicitly opt in viaREDSCRIBE_ALLOW_DEBUG_IN_PROD=1. - Turns on
SECURE_SSL_REDIRECT, HSTS, and secure cookies, trustingX-Forwarded-Protofrom 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 how to report a bug or request a change