mirror of
https://github.com/thecyberlearn/quantum-ai-v2.git
synced 2026-08-18 16:32:58 +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
|
||||
# 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 = {
|
||||
'default': {
|
||||
'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=''),
|
||||
}
|
||||
'default': dj_database_url.parse(config('DATABASE_URL'))
|
||||
}
|
||||
else:
|
||||
DATABASES = {
|
||||
|
||||
@ -5,4 +5,5 @@ stripe==12.3.0
|
||||
Pillow==11.3.0
|
||||
requests==2.32.4
|
||||
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