Skip to content

Commit

Permalink
fix env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamZamoraM committed Mar 25, 2023
1 parent 2c958f2 commit b1ab9d6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
5 changes: 1 addition & 4 deletions .env-example → env-example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENV="dev"

DJANGO_SECRET_KEY="django-insecure-aey90s^bn!0exni6@4_4^mj_@z51=ui&+7!ikkz))s5+hqq8oi"
DJANGO_SECRET_KEY=config('DJANGO_SECRET_KEY', default='change_this_in_production!')
DJANGO_ALLOWED_HOSTS='*'
CORS_ALLOW_ALL_ORIGINS=True
CORS_ALLOWED_ORIGINS=
Expand All @@ -14,6 +14,3 @@ POSTGRES_USER=test
POSTGRES_PASSWORD=test
POSTGRES_HOST=localhost
POSTGRES_PORT=5432

# DATABASE_URL format
# <database_type>://<username>:<password>@<hostname>:<database_port>/<database_name>
2 changes: 1 addition & 1 deletion lugares_seguros/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings.base')

application = get_asgi_application()
26 changes: 10 additions & 16 deletions lugares_seguros/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
"""
Django settings for lugares_seguros project.
Generated by 'django-admin startproject' using Django 4.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path
from decouple import config, Csv
import os

ENV = config('ENV', default='dev')

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -41,6 +27,7 @@
CSRF_COOKIE_SECURE = config('CSRF_COOKIE_SECURE', default=False, cast=bool)



# Application definition

INSTALLED_APPS = [
Expand All @@ -51,9 +38,11 @@
'django.contrib.messages',
'django.contrib.staticfiles',

# Apps terceras
# Apps de terceros

'rest_framework',


# Apps locales
'places',
]
Expand Down Expand Up @@ -92,8 +81,13 @@
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }

# DATABASES
PG_DB = config('POSTGRES_DB', default='')
PG_USER = config('POSTGRES_USER', default='')
PG_PASSWD = config('POSTGRES_PASSWORD', default='')
Expand Down
2 changes: 1 addition & 1 deletion lugares_seguros/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lugares_seguros.settings.base')

application = get_wsgi_application()
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
asgiref==3.6.0
backports.zoneinfo==0.2.1
Django==4.1.7
djangorestframework==3.14.0
psycopg2==2.9.5
psycopg2-binary==2.9.5
python-decouple==3.8
pytz==2022.7.1
sqlparse==0.4.3
Expand Down

0 comments on commit b1ab9d6

Please sign in to comment.