Skip to main content
SIGEP’s settings live in SIGEP/SIGEP/settings.py. Most settings work out of the box for local development, but several must be changed before you deploy to production.
Never deploy SIGEP with DEBUG = True or with the default SECRET_KEY. Both values in the repository are for development only and are publicly known.

Security settings

SECRET_KEY

The SECRET_KEY is used to sign cookies, sessions, and other cryptographic operations. Replace the default value with a strong random string before deploying:
settings.py
# Replace this with a securely generated value
SECRET_KEY = 'django-insecure-ew-qgsdn1)7=one^5^6-o99c8(ui&*t^0ksqo2vb*s5=sz)sx1'
Generate a new key using Python:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

DEBUG

Set DEBUG to False in production. When DEBUG = True, Django exposes detailed error pages and serves static and media files directly — both inappropriate for a live server:
settings.py
DEBUG = False

ALLOWED_HOSTS

Add your domain name or server IP address to ALLOWED_HOSTS. Django refuses to serve requests to hosts not listed here when DEBUG = False:
settings.py
ALLOWED_HOSTS = ['yourdomain.com', 'www.yourdomain.com']

Database

By default, SIGEP uses SQLite:
settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
        'OPTIONS': {
            'timeout': 20,
        }
    }
}
SQLite is suitable for development and small deployments. For production, switch to PostgreSQL:
settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'sigep_db',
        'USER': 'sigep_user',
        'PASSWORD': 'your-database-password',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}
Install the psycopg2 adapter to use PostgreSQL: pip install psycopg2-binary.

Custom user model

SIGEP uses a custom user model: AUTH_USER_MODEL = "principal.Usuario". Do not change this setting after you have run the initial migrations — doing so will break the database schema and all authentication-related tables.
settings.py
AUTH_USER_MODEL = "principal.Usuario"

File storage

Static files

Static assets (CSS, JavaScript, images) are collected into staticfiles/ when you run collectstatic:
settings.py
STATIC_URL = 'static/'
STATICFILES_DIRS = [BASE_DIR / 'static']
STATIC_ROOT = BASE_DIR / "staticfiles"
During development the server serves files directly from static/. In production, run python manage.py collectstatic and configure your web server to serve the staticfiles/ directory.

Media files

User-uploaded files (event images, documents) are stored under media/:
settings.py
MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
In production, configure your web server to serve this directory at the /media/ URL path.

Email

SIGEP sends email for user invite flows (set-password links). Configure Django’s email settings to match your mail provider:
settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.yourprovider.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'no-reply@yourdomain.com'
EMAIL_HOST_PASSWORD = 'your-email-password'
DEFAULT_FROM_EMAIL = 'SIGEP <no-reply@yourdomain.com>'
During development you can use the console backend to print emails to the terminal instead of sending them:
settings.py
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

System-wide configuration

Administrators can also manage key/value configuration at runtime through the built-in settings interface at /administrador/configuracion/. Changes made there do not require editing settings.py or restarting the server.

Build docs developers (and LLMs) love