mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 21:52:57 +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
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
if config('DATABASE_URL', default=''):
|
||||||
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql' if config('DATABASE_URL', default='') else 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': config('PGDATABASE', default=BASE_DIR / 'db.sqlite3'),
|
'NAME': config('PGDATABASE', default=''),
|
||||||
'USER': config('PGUSER', default=''),
|
'USER': config('PGUSER', default=''),
|
||||||
'PASSWORD': config('PGPASSWORD', default=''),
|
'PASSWORD': config('PGPASSWORD', default=''),
|
||||||
'HOST': config('PGHOST', default=''),
|
'HOST': config('PGHOST', default=''),
|
||||||
'PORT': config('PGPORT', default=''),
|
'PORT': config('PGPORT', default=''),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': BASE_DIR / 'db.sqlite3',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user