Acrylitec follows a two-layer configuration model: environment variables control secrets and deployment-specific values (database credentials, secret key, debug mode), whileDocumentation 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.
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
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/railwayDjango’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:Never commit the production value to source control.
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).A comma-separated list of hostnames Django will serve. In Add your custom domain to this list (and to
settings.py this
is a Python list, not read from an environment variable:CSRF_TRUSTED_ORIGINS) before
pointing DNS at the Railway deployment.A comma-separated list of origins (scheme + host) that Django trusts for
CSRF-protected POST requests. In Every origin must include the
settings.py this is hard-coded as a Python
list: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.| Setting | Value |
|---|---|
STATIC_URL | static/ |
STATIC_ROOT | BASE_DIR / staticfiles |
STATICFILES_DIRS | [BASE_DIR / gestion / static] |
STATICFILES_STORAGE | whitenoise.storage.CompressedManifestStaticFilesStorage |
-
During development,
runserverresolves assets directly fromgestion/static/viaSTATICFILES_DIRS. Nocollectstaticstep is needed. -
WhiteNoiseMiddlewaresits immediately afterSecurityMiddlewarein the middleware stack, intercepting static file requests before they reach Django’s view layer. -
Before every production deploy, run:
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.| Setting | Value |
|---|---|
MEDIA_URL | /media/ |
MEDIA_ROOT | os.path.join(BASE_DIR, 'media') |
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:| Setting | Value | Effect |
|---|---|---|
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 |
@login_required decorator (and Django’s built-in auth views) throughout gestion/views.py. No additional configuration is required to make them effective.