2019-10-10 07:18:34 +00:00
|
|
|
"""
|
|
|
|
Django settings for userpanel project.
|
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 2.2.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/2.2/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/2.2/ref/settings/
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
from decouple import config, Csv
|
2019-12-10 10:59:01 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2019-10-10 07:18:34 +00:00
|
|
|
from dj_database_url import parse as db_url
|
2019-12-10 10:59:01 +00:00
|
|
|
|
|
|
|
|
2019-10-10 07:18:34 +00:00
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
SECRET_KEY = config('SECRET_KEY')
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = config('DEBUG', default=False, cast=bool)
|
|
|
|
|
|
|
|
# Definition of Settings for send emails
|
|
|
|
DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', default='webmaster@localhost')
|
|
|
|
|
|
|
|
EMAIL_HOST = config('EMAIL_HOST', default='localhost')
|
|
|
|
|
|
|
|
EMAIL_HOST_USER = config('EMAIL_HOST_USER', default='')
|
|
|
|
|
|
|
|
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default='')
|
|
|
|
|
|
|
|
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[], cast=Csv())
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
'django_extensions',
|
2021-06-24 11:19:22 +00:00
|
|
|
'bootstrap4',
|
2019-10-23 11:35:43 +00:00
|
|
|
'musician',
|
2019-10-10 07:18:34 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2020-01-23 16:28:53 +00:00
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
2019-10-10 07:18:34 +00:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'userpanel.urls'
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'userpanel.wsgi.application'
|
|
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': config(
|
|
|
|
'DATABASE_URL',
|
|
|
|
default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
cast=db_url
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2019-10-30 12:05:46 +00:00
|
|
|
LOGIN_URL = '/auth/login/'
|
|
|
|
|
|
|
|
# Sessions
|
|
|
|
# https://docs.djangoproject.com/en/2.2/topics/http/sessions/#configuring-sessions
|
|
|
|
|
|
|
|
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
|
|
|
|
|
2020-01-23 16:52:49 +00:00
|
|
|
SESSION_COOKIE_SECURE = config('SESSION_COOKIE_SECURE', default=True, cast=bool)
|
2019-10-10 07:18:34 +00:00
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
|
|
|
|
2019-12-18 09:51:02 +00:00
|
|
|
# Fallback language
|
2020-01-23 16:28:53 +00:00
|
|
|
LANGUAGE_CODE = config('LANGUAGE_CODE', 'en-us')
|
|
|
|
|
|
|
|
LANGUAGES = [
|
|
|
|
('ca', _('Catalan')),
|
|
|
|
('en', _('English')),
|
|
|
|
('es', _('Spanish')),
|
|
|
|
]
|
2019-10-10 07:18:34 +00:00
|
|
|
|
2019-12-18 09:51:02 +00:00
|
|
|
TIME_ZONE = 'Europe/Madrid'
|
2019-10-10 07:18:34 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
2019-12-10 10:59:01 +00:00
|
|
|
LANGUAGES = (
|
|
|
|
('ca', _('Catalan')),
|
|
|
|
('es', _('Spanish')),
|
|
|
|
('en', _('English')),
|
|
|
|
)
|
|
|
|
|
2019-10-10 07:18:34 +00:00
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
|
|
|
STATIC_ROOT = config('STATIC_ROOT')
|
2019-10-29 09:47:50 +00:00
|
|
|
|
|
|
|
# Backend API configuration
|
|
|
|
|
|
|
|
API_BASE_URL = config('API_BASE_URL')
|
2020-01-23 15:32:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
# External services URLs
|
|
|
|
URL_DB_PHPMYADMIN = config('URL_DB_PHPMYADMIN', None)
|
|
|
|
|
|
|
|
URL_MAILTRAIN = config('URL_MAILTRAIN', None)
|
|
|
|
|
|
|
|
URL_SAAS_GITLAB = config('URL_SAAS_GITLAB', None)
|
|
|
|
|
|
|
|
URL_SAAS_OWNCLOUD = config('URL_SAAS_OWNCLOUD', None)
|
|
|
|
|
|
|
|
URL_SAAS_WORDPRESS = config('URL_SAAS_WORDPRESS', None)
|