Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/YonAnn99/Acrylitec/llms.txt

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

Acrylitec follows a two-layer configuration model: environment variables control secrets and deployment-specific values (database credentials, secret key, debug mode), while core/settings.py encodes everything else — installed apps, middleware, URL routing, static/media paths, and authentication redirects. In local development you can run the project with no environment variables at all; in production every secret must be supplied through Railway’s variable management UI or your own secret store.

Environment Variables

DATABASE_URL
string
PostgreSQL connection string in the format postgresql://user:pass@host:5432/dbname. When this variable is set, core/settings.py configures Django to use PostgreSQL via dj-database-url with a conn_max_age of 600 seconds. When it is not set (the default in a fresh clone), Django falls back to a local SQLite file at BASE_DIR/db.sqlite3 automatically — no additional configuration required.Example: postgresql://postgres:secret@monorail.proxy.rlwy.net:12345/railway
SECRET_KEY
string
required
Django’s secret key, used for cryptographic signing of sessions, CSRF tokens, and password-reset links. The repository contains a hard-coded insecure default value — this must be overridden with a strong random string in any production environment. Generate one with:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
Never commit the production value to source control.
DEBUG
boolean
default:"True"
Controls Django’s debug mode. When True, Django renders full tracebacks in the browser and serves media files through the development URL patterns. Set to False in production to suppress error details from end users and enable security hardening (e.g. SECURE_SSL_REDIRECT). Note that settings.py currently hard-codes DEBUG = True; override it via an environment variable using a package such as django-environ or python-decouple (see tip below).
ALLOWED_HOSTS
string
A comma-separated list of hostnames Django will serve. In settings.py this is a Python list, not read from an environment variable:
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'acrylitec-production.up.railway.app']
Add your custom domain to this list (and to CSRF_TRUSTED_ORIGINS) before pointing DNS at the Railway deployment.
CSRF_TRUSTED_ORIGINS
string
A comma-separated list of origins (scheme + host) that Django trusts for CSRF-protected POST requests. In settings.py this is hard-coded as a Python list:
CSRF_TRUSTED_ORIGINS = ['https://acrylitec-production.up.railway.app']
Every origin must include the https:// scheme prefix. If you attach a custom domain to Railway, add it here alongside the default Railway domain; otherwise login and form submissions will fail with a CSRF verification error.

Static Files

Acrylitec uses WhiteNoise to serve compressed, cache-busted static assets without a dedicated CDN or web server in front of Django.
SettingValue
STATIC_URLstatic/
STATIC_ROOTBASE_DIR / staticfiles
STATICFILES_DIRS[BASE_DIR / gestion / static]
STATICFILES_STORAGEwhitenoise.storage.CompressedManifestStaticFilesStorage
How it works:
  • During development, runserver resolves assets directly from gestion/static/ via STATICFILES_DIRS. No collectstatic step is needed.
  • WhiteNoiseMiddleware sits immediately after SecurityMiddleware in the middleware stack, intercepting static file requests before they reach Django’s view layer.
  • Before every production deploy, run:
    python manage.py collectstatic --no-input
    
    This copies all static assets into staticfiles/, where WhiteNoise can fingerprint and compress them. Railway can be configured to run this command as part of its build step.

Media Files

Product photos uploaded through the product form are stored as files on disk, separate from static assets.
SettingValue
MEDIA_URL/media/
MEDIA_ROOTos.path.join(BASE_DIR, 'media')
Development: When DEBUG = True, Django’s URL configuration appends static(MEDIA_URL, document_root=MEDIA_ROOT) to urlpatterns, so uploaded images are served at /media/<filename> by the development server automatically. Production: Railway’s filesystem is ephemeral — files written to disk are lost when the container restarts or re-deploys. For persistent media storage in production, integrate an object storage service such as Amazon S3 or Cloudflare R2 using django-storages and point DEFAULT_FILE_STORAGE at your bucket backend.

Authentication Settings

Acrylitec configures Django’s built-in authentication system with the following URL redirects:
SettingValueEffect
LOGIN_URL/login/Unauthenticated requests to protected views redirect here
LOGIN_REDIRECT_URL/cotizaciones/Successful login lands on the quotations dashboard
LOGOUT_REDIRECT_URL/login/After logout, users return to the login page
These values are used by the @login_required decorator (and Django’s built-in auth views) throughout gestion/views.py. No additional configuration is required to make them effective.
Use python-decouple or django-environ to load settings from a .env file in local development. This lets you override DEBUG, SECRET_KEY, and DATABASE_URL without modifying settings.py, keeping the same code path that Railway uses in production:
# .env (never commit this file)
SECRET_KEY=your-local-dev-key-here
DEBUG=True
# DATABASE_URL is intentionally omitted to use SQLite
Add .env to .gitignore before committing.

Build docs developers (and LLMs) love