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.

Railway is the intended production target for Acrylitec. When deployed, the Procfile instructs Railway to start a gunicorn WSGI server instead of Django’s development server, and the DATABASE_URL environment variable (automatically injected by Railway’s PostgreSQL plugin) switches the database engine from SQLite to PostgreSQL. The result is a fully stateful, publicly accessible deployment with a single Railway project containing two services: the Django web process and the managed database.

Procfile

Railway reads the Procfile in the repository root to determine how to start the web process:
web: gunicorn core.wsgi:application --bind 0.0.0.0:$PORT
$PORT is injected by Railway at runtime. gunicorn binds to that port and serves Django’s WSGI application defined in core/wsgi.py.

Deployment Steps

1

Create a Railway Project

  1. Go to railway.app and sign in.
  2. Click New ProjectDeploy from GitHub repo.
  3. Authorize Railway to access your GitHub account if prompted.
  4. Select the YonAnn99/Acrylitec repository.
Railway detects the Procfile automatically and queues an initial build using the requirements.txt to install dependencies.
2

Add a PostgreSQL Service

  1. Inside your Railway project dashboard, click + NewDatabaseAdd PostgreSQL.
  2. Railway provisions a managed PostgreSQL instance and automatically creates a DATABASE_URL variable in the project environment.
Because core/settings.py checks for DATABASE_URL at startup, the application will switch from SQLite to PostgreSQL on the next deploy with no code changes required.
3

Set Required Environment Variables

Navigate to your web service → Variables tab and configure the following:
VariableValueNotes
DATABASE_URL(auto-set by PostgreSQL plugin)Do not override manually
SECRET_KEYA long, random stringReplace the insecure default from settings.py
DEBUGFalseMust be False in production
ALLOWED_HOSTSacrylitec-production.up.railway.appAdd custom domains separated by commas
CSRF_TRUSTED_ORIGINShttps://acrylitec-production.up.railway.appAdd https:// prefix; required for CSRF-protected POST forms on custom domains
To generate a strong SECRET_KEY, run the following locally:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
4

Run Database Migrations

After the initial deploy completes, run migrations against the Railway PostgreSQL database using the Railway CLI:
# Install the CLI (macOS/Linux)
brew install railway     # or: npm i -g @railway/cli

# Authenticate and link to your project
railway login
railway link

# Run migrations against the production database
railway run python manage.py migrate
Alternatively, add a release command in Railway’s SettingsDeployStart Command override, or use a pre-deploy script, so migrations run automatically on every deploy.
5

Create a Superuser

Create the initial admin account on the production database:
railway run python manage.py createsuperuser
Follow the prompts. This account is used to log in to both /admin/ and the main Acrylitec dashboard.
6

Verify the Deployment

  1. In the Railway dashboard, click the generated domain (e.g. https://acrylitec-production.up.railway.app).
  2. You should be redirected to /login/ — log in with the superuser credentials you created above.
  3. After login, Django redirects to /cotizaciones/ (the quotations dashboard), confirming the app and database are connected correctly.
  4. Navigate to /configuracion/ to add materials and a cost tabulador before generating your first quotation.
CSRF_TRUSTED_ORIGINS in settings.py already includes https://acrylitec-production.up.railway.app, so CSRF-protected form submissions (login, create quotation, etc.) work out of the box on the default Railway domain. If you attach a custom domain, add it to CSRF_TRUSTED_ORIGINS as well.
Change SECRET_KEY before going live. The default value in settings.py is:
django-insecure-)ri21c!ubq8y!%fo_z%#o#yx9t60pt4&yyc-kos!txlubpx!+5
This key is publicly visible in the repository. Anyone who knows it can forge session cookies and CSRF tokens. Generate a new key and set it as the SECRET_KEY environment variable in Railway before accepting real traffic.

Build docs developers (and LLMs) love