mirror of
https://github.com/thecyberlearn/quantum-ai.git
synced 2026-08-18 17:32:59 +00:00
Fix Railway database configuration
- Use dj-database-url to properly parse DATABASE_URL for Railway deployment - Add dj-database-url==2.1.0 to requirements.txt - Simplify database config to work with Railway's automatic DATABASE_URL 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
cb04153d5e
commit
3c99324676
@ -87,16 +87,12 @@ WSGI_APPLICATION = 'netcop_hub.wsgi.application'
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||||
|
|
||||||
if config('RAILWAY_ENVIRONMENT', default=''):
|
import dj_database_url
|
||||||
|
|
||||||
|
# Use DATABASE_URL if available (Railway, Heroku, etc.)
|
||||||
|
if config('DATABASE_URL', default=''):
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': dj_database_url.parse(config('DATABASE_URL'))
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
|
||||||
'NAME': config('PGDATABASE', default=''),
|
|
||||||
'USER': config('PGUSER', default=''),
|
|
||||||
'PASSWORD': config('PGPASSWORD', default=''),
|
|
||||||
'HOST': config('PGHOST', default=''),
|
|
||||||
'PORT': config('PGPORT', default=''),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
|
|||||||
@ -6,3 +6,4 @@ Pillow==11.3.0
|
|||||||
requests==2.32.4
|
requests==2.32.4
|
||||||
gunicorn==21.2.0
|
gunicorn==21.2.0
|
||||||
psycopg2-binary==2.9.9
|
psycopg2-binary==2.9.9
|
||||||
|
dj-database-url==2.1.0
|
||||||
Loading…
Reference in New Issue
Block a user