|
|
@ -14,6 +14,7 @@ See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ |
|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
import logging |
|
|
import logging |
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
from decouple import config |
|
|
from decouple import config |
|
|
from dj_database_url import parse as db_url |
|
|
from dj_database_url import parse as db_url |
|
|
@ -31,6 +32,8 @@ SECRET_KEY = config('SECRET_KEY', default='') |
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
|
DEBUG = config('DEBUG', default=False, cast=bool) |
|
|
DEBUG = config('DEBUG', default=False, cast=bool) |
|
|
|
|
|
|
|
|
|
|
|
DOCKER_FILE = config('DOCKER_FILE', default=False, cast=bool) |
|
|
|
|
|
|
|
|
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' |
|
|
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' |
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = ['*'] |
|
|
ALLOWED_HOSTS = ['*'] |
|
|
@ -160,13 +163,20 @@ WSGI_APPLICATION = 'sapl.wsgi.application' |
|
|
|
|
|
|
|
|
# Database |
|
|
# Database |
|
|
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
|
|
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
|
|
|
|
|
if DOCKER_FILE: |
|
|
DATABASES = { |
|
|
DATABASES = { |
|
|
'default': config( |
|
|
'default': { |
|
|
'DATABASE_URL', default='sqlite://:memory:', |
|
|
'ENGINE': 'django.db.backends.sqlite3', |
|
|
cast=db_url, |
|
|
'NAME': os.path.join(PROJECT_DIR, 'sapl.db'), |
|
|
) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else: |
|
|
|
|
|
DATABASES = { |
|
|
|
|
|
'default': config( |
|
|
|
|
|
'DATABASE_URL', default='sqlite://:memory:', |
|
|
|
|
|
cast=db_url, |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# troque no caso de reimplementação da classe User conforme |
|
|
# troque no caso de reimplementação da classe User conforme |
|
|
# https://docs.djangoproject.com/en/1.9/topics/auth/customizing/#substituting-a-custom-user-model |
|
|
# https://docs.djangoproject.com/en/1.9/topics/auth/customizing/#substituting-a-custom-user-model |
|
|
|