Browse Source

Integra o python-decouple

pull/253/head
Eduardo Calil 9 years ago
committed by Edward Ribeiro
parent
commit
e7b8591ecd
  1. 12
      decouple.env
  2. 1
      requirements/requirements.txt
  3. 26
      sapl/settings.py

12
decouple.env

@ -0,0 +1,12 @@
SECRET_KEY=!9g1-#la+#(oft(v-y1qhy$jk-2$24pdk69#b_jfqyv!*%a_)t
DEBUG=True
NAME=sapl
USER=sapl
PASSWORD=sapl
HOST=localhost
PORT=5432
EMAIL_USE_TLS = True
EMAIL_HOST = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 587

1
requirements/requirements.txt

@ -5,6 +5,7 @@ django-bower==5.1.0
django-braces==1.8.1 django-braces==1.8.1
django-compressor==2.0 django-compressor==2.0
django-crispy-forms==1.6.0 django-crispy-forms==1.6.0
python-decouple==3.0
django-extra-views==0.7.1 django-extra-views==0.7.1
django-model-utils==2.4 django-model-utils==2.4
django-sass-processor==0.3.4 django-sass-processor==0.3.4

26
sapl/settings.py

@ -14,16 +14,18 @@ from unipath import Path
from .temp_suppress_crispy_form_warnings import \ from .temp_suppress_crispy_form_warnings import \
SUPRESS_CRISPY_FORM_WARNINGS_LOGGING SUPRESS_CRISPY_FORM_WARNINGS_LOGGING
from decouple import config
BASE_DIR = Path(__file__).ancestor(2) BASE_DIR = Path(__file__).ancestor(2)
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!9g1-#la+#(oft(v-y1qhy$jk-2$24pdk69#b_jfqyv!*%a_)t' SECRET_KEY = config('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = config('DEBUG', default=False, cast=bool)
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
@ -107,19 +109,19 @@ WSGI_APPLICATION = 'sapl.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', 'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'sapl', 'NAME': config('NAME'),
'USER': 'sapl', 'USER': config('USER'),
'PASSWORD': 'sapl', 'PASSWORD': config('PASSWORD'),
'HOST': 'localhost', 'HOST': config('HOST'),
'PORT': '5432', 'PORT': config('PORT'),
} }
} }
EMAIL_USE_TLS = True EMAIL_USE_TLS = config('EMAIL_USE_TLS')
EMAIL_HOST = '' EMAIL_HOST = config('EMAIL_HOST')
EMAIL_HOST_USER = '' EMAIL_HOST_USER = config('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = '' EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 587 EMAIL_PORT = config('EMAIL_PORT', cast=int)
MAX_DOC_UPLOAD_SIZE = 5*1024*1024 # 5MB MAX_DOC_UPLOAD_SIZE = 5*1024*1024 # 5MB
MAX_IMAGE_UPLOAD_SIZE = 2*1024*1024 # 2MB MAX_IMAGE_UPLOAD_SIZE = 2*1024*1024 # 2MB

Loading…
Cancel
Save