1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Make erdnaxe be happy

This commit is contained in:
Yohann D'ANELLO
2020-03-07 22:28:59 +01:00
parent 3eb0c185f2
commit d0206fb790
30 changed files with 215 additions and 205 deletions

View File

@ -1,8 +1,6 @@
import os
import re
from .base import *
def read_env():
"""Pulled from Honcho code with minor updates, reads local default
environment variables from a .env file located in the project root
@ -25,14 +23,16 @@ def read_env():
val = re.sub(r'\\(.)', r'\1', m3.group(1))
os.environ.setdefault(key, val)
read_env()
app_stage = os.environ.get('DJANGO_APP_STAGE', 'dev')
if app_stage == 'prod':
from .production import *
DATABASES["default"]["PASSWORD"] = os.environ.get('DJANGO_DB_PASSWORD','CHANGE_ME_IN_ENV_SETTINGS')
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY','CHANGE_ME_IN_ENV_SETTINGS')
ALLOWED_HOSTS.append(os.environ.get('ALLOWED_HOSTS','localhost'))
DATABASES["default"]["PASSWORD"] = os.environ.get('DJANGO_DB_PASSWORD', 'CHANGE_ME_IN_ENV_SETTINGS')
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'CHANGE_ME_IN_ENV_SETTINGS')
ALLOWED_HOSTS.append(os.environ.get('ALLOWED_HOSTS', 'localhost'))
else:
from .development import *
@ -43,4 +43,3 @@ except ImportError:
# env variables set at the of in /env/bin/activate
# don't forget to unset in deactivate !

View File

@ -97,7 +97,7 @@ TEMPLATES = [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
# 'django.template.context_processors.media',
# 'django.template.context_processors.media',
],
},
},
@ -183,7 +183,7 @@ FIXTURE_DIRS = [os.path.join(BASE_DIR, "note_kfet/fixtures")]
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = os.path.join(BASE_DIR,"static/")
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
# STATICFILES_DIRS = [
# os.path.join(BASE_DIR, 'static')]
STATICFILES_DIRS = []
@ -195,8 +195,8 @@ STATIC_URL = '/static/'
ALIAS_VALIDATOR_REGEX = r''
MEDIA_ROOT=os.path.join(BASE_DIR,"media")
MEDIA_URL='/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = '/media/'
# Profile Picture Settings
PIC_WIDTH = 200
@ -211,7 +211,7 @@ CAS_SHOW_POWERED = False
CAS_REDIRECT_TO_LOGIN_AFTER_LOGOUT = False
CAS_INFO_MESSAGES = {
"cas_explained": {
"message":_(
"message": _(
u"The Central Authentication Service grants you access to most of our websites by "
u"authenticating only once, so you don't need to type your credentials again unless "
u"your session expires or you logout."
@ -224,4 +224,3 @@ CAS_INFO_MESSAGES = {
CAS_INFO_MESSAGES_ORDER = [
'cas_explained',
]

View File

@ -11,10 +11,11 @@
# - and more ...
import os
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
from . import *
import os
DATABASES = {
'default': {
@ -53,8 +54,6 @@ SESSION_COOKIE_AGE = 60 * 60 * 3
# Can be modified in secrets.py
CAS_SERVER_URL = "http://localhost:8000/cas/"
STATIC_ROOT = '' # not needed in development settings
STATIC_ROOT = '' # not needed in development settings
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')]
os.path.join(BASE_DIR, 'static')]

View File

@ -26,7 +26,7 @@ DATABASES = {
DEBUG = True
# Mandatory !
ALLOWED_HOSTS = ['127.0.0.1','note.comby.xyz']
ALLOWED_HOSTS = ['127.0.0.1', 'note.comby.xyz']
# Emails
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'