-
Notifications
You must be signed in to change notification settings - Fork 5
/
settings_custom.py.edit
116 lines (88 loc) · 3.38 KB
/
settings_custom.py.edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import environ
import os
env = environ.Env()
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
SECRET_KEY = 'your-super-secret-key'
SITE_URL = 'http://localhost:8000'
MIAR_URL = 'http://localhost:3000'
ARGENTINAGOBAR_URL = 'https://www.argentina.gob.ar'
ALLOWED_HOSTS = ['*']
SECURE_SSL_REDIRECT = not DEBUG
SESSION_COOKIE_SECURE = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG
LOCAL_APPS = ['debug_toolbar',]
LOCAL_MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware',]
# PostgreSQL Docker using local.yml
DATABASES = {"default": env.db("DATABASE_URL")}
DATABASES["default"]["ATOMIC_REQUESTS"] = True
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'KEY_PREFIX': 'localhost',
}
}
SESSION_ENGINE = 'django.contrib.sessions.backends.db'
SERVER_EMAIL = 'Mi Argentina <[email protected]>'
DEFAULT_FROM_EMAIL = SERVER_EMAIL
# MAILHOG
EMAIL_BACKEND = env(
"DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend"
)
EMAIL_TIMEOUT = 5
EMAIL_USE_TLS = False
EMAIL_HOST = env("EMAIL_HOST", default="mailhog")
EMAIL_PORT = env("EMAIL_PORT", default="1025")
# reCaptcha
RECAPTCHA_ENABLE = False
RECAPTCHA_KEY = ''
RECAPTCHA_SECRET = ''
# Debug Toolbar
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG={
'SHOW_TOOLBAR_CALLBACK':show_toolbar
}
# Celery Docker
CELERY_BROKER_URL = 'redis://redis:6379/'
OIDC_AUTH = {
# Specify OpenID Connect endpoint. Configuration will be
# automatically done based on the discovery document found
# at <endpoint>/.well-known/openid-configuration
'OIDC_ENDPOINT': 'http://localhost:8000',
# Accepted audiences the ID Tokens can be issued to
'OIDC_AUDIENCES': ('myapp',),
# (Optional) Function that resolves id_token into user.
# This function receives a request and an id_token dict and expects to
# return a User object. The default implementation tries to find the user
# based on username (natural key) taken from the 'sub'-claim of the
# id_token.
'OIDC_RESOLVE_USER_FUNCTION': 'oidc_auth.authentication.get_user_by_id',
# (Optional) Number of seconds in the past valid tokens can be
# issued (default 600)
'OIDC_LEEWAY': 600,
# (Optional) Time before signing keys will be refreshed (default 24 hrs)
'OIDC_JWKS_EXPIRATION_TIME': 24 * 60 * 60,
# (Optional) Time before bearer token validity is verified again (default 10 minutes)
'OIDC_BEARER_TOKEN_EXPIRATION_TIME': 10 * 60,
# (Optional) Token prefix in JWT authorization header (default 'JWT')
'JWT_AUTH_HEADER_PREFIX': 'JWT',
# (Optional) Token prefix in Bearer authorization header (default 'Bearer')
'BEARER_AUTH_HEADER_PREFIX': 'Bearer',
}
# Cache de base de datos
CACHEOPS_REDIS = 'redis://redis:6379/'