Skip to content

Commit

Permalink
feat: change db flexibility to dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew4Coding committed Oct 11, 2024
1 parent ddc119c commit ce1dae9
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions eventyog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,24 @@

load_dotenv() # Load environment variables from a .env file

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME', 'eventyog'),
'USER': os.getenv('DB_USER', 'pemilos24_owner'),
'PASSWORD': os.getenv('DB_PASSWORD', 'DRzSsw7Pc2HE'),
'HOST': os.getenv('DB_HOST', 'ep-late-cloud-a1j1feg2-pooler.ap-southeast-1.aws.neon.tech'),
'PORT': os.getenv('DB_PORT', 5432),
if (os.getenv('PROD') != 'True'):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
}

else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME', 'eventyog'),
'USER': os.getenv('DB_USER', 'pemilos24_owner'),
'PASSWORD': os.getenv('DB_PASSWORD', 'DRzSsw7Pc2HE'),
'HOST': os.getenv('DB_HOST', 'ep-late-cloud-a1j1feg2-pooler.ap-southeast-1.aws.neon.tech'),
'PORT': os.getenv('DB_PORT', 5432),
}
}
# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators

Expand Down

0 comments on commit ce1dae9

Please sign in to comment.