Skip to content

Commit

Permalink
settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamZamoraM committed Mar 25, 2023
1 parent 3131d96 commit 2c958f2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions lugares_seguros/settings.py → lugares_seguros/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@


# DATABASES
PG_DB = config('POSTGRES_DB', default='')
PG_USER = config('POSTGRES_USER', default='')
PG_PASSWD = config('POSTGRES_PASSWORD', default='')
PG_HOST = config('POSTGRES_HOST', default='127.0.0.1')
PG_PORT = config('POSTGRES_PORT', cast=int, default=5432)

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ENGINE': 'django.db.backends.postgresql',
'NAME': PG_DB,
'USER': PG_USER,
'PASSWORD': PG_PASSWD,
'HOST': PG_HOST,
'PORT': PG_PORT,
}
}

Expand Down
1 change: 1 addition & 0 deletions lugares_seguros/settings/dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .base import *
1 change: 1 addition & 0 deletions lugares_seguros/settings/prod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .base import *
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings.dev')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down

0 comments on commit 2c958f2

Please sign in to comment.