Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jtapieromalambo-ctrl/Signia/llms.txt

Use this file to discover all available pages before exploring further.

Signia supports two database backends out of the box: a zero-configuration SQLite file for local development and a Neon-hosted PostgreSQL instance for production. The active backend is determined entirely by the DATABASE_URL environment variable — when the variable is absent, Django falls back to db.sqlite3 automatically. Both paths use the same Django migration system, so switching between them requires no code changes.

Choosing a Backend

SQLite requires no installation or configuration. Django creates db.sqlite3 in the project root the first time you run migrations. This is the recommended starting point for all local development work.Setup steps:
  1. Ensure DATABASE_URL is not set in your .env file (or comment it out):
    # DATABASE_URL=  ← leave this line absent or commented
    
  2. Apply all migrations to create the database schema:
    python manage.py migrate
    
  3. Create an administrator account:
    python manage.py createsuperuser
    
  4. Start the development server:
    python manage.py runserver
    
The SQLite file at db.sqlite3 is listed in .gitignore and should never be committed.

Connection Pooling and SSL Settings

Signia’s settings.py configures the database connection with several options specifically required for Neon’s serverless architecture:
DATABASES = {
    'default': {
        **dj_database_url.parse(config('DATABASE_URL', default='sqlite:///' + str(BASE_DIR / 'db.sqlite3')), conn_max_age=0),
        'DISABLE_SERVER_SIDE_CURSORS': True,
        'OPTIONS': {
            'sslmode': 'require',
            'connect_timeout': 10,
            'keepalives': 1,
            'keepalives_idle': 30,
            'keepalives_interval': 5,
            'keepalives_count': 5,
        },
    }
}
DISABLE_SERVER_SIDE_CURSORS = True is required for Neon’s connection pooling (PgBouncer). Neon uses a pooler that does not support PostgreSQL server-side cursors. Without this setting, large querysets that Django evaluates with cursors will raise a ProgrammingError at runtime.
The conn_max_age=0 setting keeps connections short-lived, which is the correct strategy for a serverless database that may suspend compute between requests.

DATABASE_URL Format Reference

postgresql://USER:PASSWORD@HOST/DBNAME?sslmode=require
ComponentExample valueNotes
USERsignia_ownerDatabase role created by Neon
PASSWORDabc123xyzShown once in Neon dashboard on creation
HOSTep-xyz.us-east-2.aws.neon.techIncludes the Neon endpoint ID prefix
DBNAMEsigniaDefault database name
sslmoderequireMandatory — do not omit

Migration Commands

Run these commands whenever you create or pull new database schema changes:
# Apply all pending migrations
python manage.py migrate

# Create new migration files after changing a model
python manage.py makemigrations

# Preview the SQL that a migration will execute (dry run)
python manage.py sqlmigrate <app_label> <migration_number>

# Check for migration conflicts without applying them
python manage.py migrate --check

Creating a Superuser

The superuser account grants access to the Django admin panel at /django-admin/ and the video administration panel at /admin-videos/. Create one after running migrations on any fresh database:
python manage.py createsuperuser
Follow the prompts to set an email address and password. The email address must be unique and will be used for login, since Signia is configured with ACCOUNT_AUTHENTICATION_METHOD = 'email'.

Build docs developers (and LLMs) love