mirror of
https://github.com/thecyberlearn/quantum-ai-v2.git
synced 2026-08-18 12:32:59 +00:00
Fix database configuration for local development
Use SQLite locally and PostgreSQL only when DATABASE_URL is set (Railway) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b495c23446
commit
338de02bbb
@ -87,16 +87,24 @@ WSGI_APPLICATION = 'netcop_hub.wsgi.application'
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql' if config('DATABASE_URL', default='') else 'django.db.backends.sqlite3',
|
||||
'NAME': config('PGDATABASE', default=BASE_DIR / 'db.sqlite3'),
|
||||
'USER': config('PGUSER', default=''),
|
||||
'PASSWORD': config('PGPASSWORD', default=''),
|
||||
'HOST': config('PGHOST', default=''),
|
||||
'PORT': config('PGPORT', default=''),
|
||||
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=''),
|
||||
}
|
||||
}
|
||||
else:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
|
||||
Loading…
Reference in New Issue
Block a user