GastroMóvil uses MySQL as its only supported database engine. There is no SQLite fallback — theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lffiesco-svg/gastromovil/llms.txt
Use this file to discover all available pages before exploring further.
DATABASES setting in settings.py is always configured for django.db.backends.mysql, relying on PyMySQL as the drop-in MySQLdb adapter. All primary keys across every model are 64-bit integers (BigAutoField), and sessions are stored in the same MySQL database using Django’s default session backend.
How PyMySQL is Wired In
At the very top ofsettings.py, before any Django import, PyMySQL patches itself to masquerade as MySQLdb:
ImproperlyConfigured error at startup because the database backend is resolved during the DATABASES parsing phase.
DATABASES Configuration
The full database block fromsettings.py reads all connection parameters from environment variables via python-decouple. When USE_DB_SSL=True the connection is wrapped in an SSL context using the certifi CA bundle:
check_hostname is intentionally set to False because cloud-managed MySQL endpoints (Railway, PlanetScale, etc.) frequently serve a certificate whose Common Name does not match the connection hostname.
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' is set globally, so
every model table uses a BIGINT UNSIGNED auto-increment primary key unless
the model explicitly overrides it.Local Setup
Install MySQL
Install MySQL 8.x on your machine. On macOS you can use Homebrew
(
brew install mysql); on Ubuntu/Debian use apt install mysql-server.
Make sure the MySQL service is running before proceeding.Create the database
Connect to MySQL as root and create the application database with full
Unicode support:Then create a dedicated user and grant privileges:
Apps with Migrations
The following first-party Django apps each carry their own migration history and will have tables created duringmigrate:
| App | Description |
|---|---|
usuarios | Custom user model, addresses, ratings, password-recovery codes |
restaurantes | Restaurants, categories, and products |
pedidos | Order lifecycle and line items |
repartidores | Delivery driver profiles and assignments |
core | Site-wide pages and shared models |
django.contrib.auth, django.contrib.sessions, allauth, rest_framework, etc. — also create their own tables on first migration.
Session Storage
GastroMóvil uses Django’s default database-backed session engine. Sessions expire after 30 minutes of inactivity and are also destroyed when the browser closes:SESSION_SAVE_EVERY_REQUEST = True resets the 30-minute timer on every authenticated request, keeping active users from being unexpectedly logged out mid-session.
Railway Deployment
Provision the MySQL plugin
In your Railway project dashboard, click New → Database →
MySQL. Railway automatically provisions a MySQL 8 instance and injects
a
DATABASE_URL variable — but GastroMóvil uses individual variables, so
you need to copy the components manually.Copy connection variables
Open the Railway MySQL service, navigate to the Variables tab, and set
the following in your GastroMóvil service’s environment: