joeni

settings.py

1
"""
2
Django settings for Joeni project.
3
4
Generated by 'django-admin startproject' using Django 2.0b1.
5
6
For more information on this file, see
7
https://docs.djangoproject.com/en/dev/topics/settings/
8
9
For the full list of settings and their values, see
10
https://docs.djangoproject.com/en/dev/ref/settings/
11
"""
12
13
import os
14
15
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19
# Quick-start development settings - unsuitable for production
20
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
21
22
# SECURITY WARNING: keep the secret key used in production secret!
23
SECRET_KEY = '!2634qc=b*lp0=helzcmvb3+1_wcl!6z@mhzi%p(vg7odq&gfz'
24
# TEMP Password: adminadmin | admin
25
26
# SECURITY WARNING: don't run with debug turned on in production!
27
DEBUG = True
28
29
ALLOWED_HOSTS = []
30
31
32
# Application definition
33
34
INSTALLED_APPS = [
35
    'django.contrib.admin',
36
    'django.contrib.auth',
37
    'django.contrib.contenttypes',
38
    'django.contrib.humanize',
39
    'django.contrib.sessions',
40
    'django.contrib.messages',
41
    'django.contrib.staticfiles',
42
    'administration',
43
    'agora',
44
    'courses',
45
    'joeni',
46
]
47
48
MIDDLEWARE = [
49
    'django.middleware.security.SecurityMiddleware',
50
    'django.middleware.locale.LocaleMiddleware',
51
    'django.middleware.common.CommonMiddleware',
52
    'django.middleware.csrf.CsrfViewMiddleware',
53
    'django.contrib.sessions.middleware.SessionMiddleware',
54
    'django.contrib.auth.middleware.AuthenticationMiddleware',
55
    'django.contrib.sessions.middleware.SessionMiddleware',
56
    'django.contrib.messages.middleware.MessageMiddleware',
57
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
58
    'django.middleware.security.SecurityMiddleware',
59
    # Caching middleware
60
    'django.middleware.cache.UpdateCacheMiddleware',
61
    'django.middleware.common.CommonMiddleware',
62
    'django.middleware.cache.FetchFromCacheMiddleware',
63
]
64
65
# Caching settings
66
CACHE_MIDDLEWARE_ALIAS = 'default'
67
CACHE_MIDDLEWARE_SECONDS = 300
68
CACHE_MIDDLEWARE_KEY_PREFIX = ''
69
70
ROOT_URLCONF = 'joeni.urls'
71
72
TEMPLATES = [
73
    {
74
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
75
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
76
        'APP_DIRS': True,
77
        'OPTIONS': {
78
            'context_processors': [
79
                'django.template.context_processors.debug',
80
                'django.template.context_processors.request',
81
                'django.contrib.auth.context_processors.auth',
82
                'django.contrib.messages.context_processors.messages',
83
            ],
84
        },
85
    },
86
]
87
88
#WSGI_APPLICATION = 'joeni.wsgi.application'
89
90
91
# Database
92
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
93
94
DATABASES = {
95
    'default': {
96
        'ENGINE': 'django.db.backends.sqlite3',
97
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
98
    }
99
}
100
101
# Page to display when a user needs / wants to log in
102
LOGIN_URL = '/login'
103
104
# Custom User model
105
AUTH_USER_MODEL = 'administration.User'
106
107
# Password validation
108
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
109
110
AUTH_PASSWORD_VALIDATORS = []
111
if not DEBUG:
112
    # XXX: For testing and easily creating new accounts, I've disabled the
113
    # validators to make it easier to work with.
114
    AUTH_PASSWORD_VALIDATORS = [
115
        {
116
            'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
117
        },
118
        {
119
            'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
120
            'OPTIONS': {
121
                'min_length': 16,
122
            }
123
        },
124
        {
125
            'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
126
        },
127
        {
128
            'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
129
        },
130
    ]
131
132
CACHES = {
133
    'default': {
134
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
135
    }
136
}
137
138
# Internationalization
139
# https://docs.djangoproject.com/en/dev/topics/i18n/
140
141
LANGUAGE_CODE = 'en-us'
142
143
TIME_ZONE = 'Europe/Brussels'
144
145
USE_I18N = True
146
147
USE_L10N = True
148
149
USE_TZ = True
150
151
152
# Static files (CSS, JavaScript, Images)
153
# https://docs.djangoproject.com/en/dev/howto/static-files/
154
155
STATICFILES_DIRS = [
156
    BASE_DIR + "/static",
157
    ]
158
#STATIC_ROOT = BASE_DIR + '/static/'
159
MEDIA_ROOT = BASE_DIR + '/media/'
160
STATIC_URL = '/static/'
161
MEDIA_URL = '/media/'
162