· 7 years ago · Mar 01, 2018, 03:02 PM
1jango settings for my_apps project.
2
3Generated by 'django-admin startproject' using Django 1.9.
4
5For more information on this file, see
6https://docs.djangoproject.com/en/1.9/topics/settings/
7
8For the full list of settings and their values, see
9https://docs.djangoproject.com/en/1.9/ref/settings/
10"""
11
12import os
13os.environ['DJANGO_SETTINGS_MODULE'] = 'school.settings'
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17MEDIA_DIR = os.path.join(BASE_DIR, 'media')
18
19
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
22
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = 'whenindarkletyourheartshowyoutheway'
25
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
28
29ALLOWED_HOSTS = ['*']
30
31SITE_ID = 1
32
33# Application definition
34
35INSTALLED_APPS = [
36
37 'embu.apps.EmbuConfig',
38 'django.contrib.auth',
39
40 'django.contrib.staticfiles',
41 'django.contrib.admin',
42 'django.contrib.contenttypes',
43 'django.contrib.sessions',
44 'django.contrib.messages',
45 'home.apps.HomeConfig',
46 'events.apps.EventsConfig',
47 'student.apps.StudentConfig',
48 'material',
49 'django.contrib.sites',
50 'django.contrib.sitemaps',
51
52
53
54
55
56
57
58
59
60
61 ]
62
63
64MIDDLEWARE_CLASSES = [
65 'django.middleware.security.SecurityMiddleware',
66 'django.contrib.sessions.middleware.SessionMiddleware',
67 'django.middleware.common.CommonMiddleware',
68 'django.middleware.csrf.CsrfViewMiddleware',
69 'django.contrib.auth.middleware.AuthenticationMiddleware',
70 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
71 'django.contrib.messages.middleware.MessageMiddleware',
72 'django.middleware.clickjacking.XFrameOptionsMiddleware',
73
74
75
76
77]
78
79ROOT_URLCONF = 'school.urls'
80
81TEMPLATES = [
82 {
83 'BACKEND': 'django.template.backends.django.DjangoTemplates',
84 'DIRS': [os.path.join(BASE_DIR, 'templates')]
85 ,
86 'APP_DIRS': True,
87 'OPTIONS': {
88 'context_processors': [
89 'django.template.context_processors.debug',
90 'django.template.context_processors.request',
91 'django.contrib.auth.context_processors.auth',
92 'django.core.context_processors.static',
93 'django.contrib.messages.context_processors.messages',
94 'django.template.context_processors.media',
95 ],
96 },
97 },
98]
99
100WSGI_APPLICATION = 'school.wsgi.application'
101WAGTAIL_SITE_NAME = 'News and Events'
102
103
104# Database
105# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
106
107DATABASES = {
108 'default': {
109 'ENGINE':
110 'django.db.backends.mysql',
111 'NAME': 'ecbst$ecbst',
112 'USER': 'ecbst',
113 'PASSWORD': 'jodohouse',
114 'HOST': 'ecbst',
115
116 }
117}
118
119
120
121# Password validation
122# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
123
124AUTH_PASSWORD_VALIDATORS = [
125 {
126 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
127 },
128 {
129 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
130 },
131 {
132 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
133 },
134 {
135 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
136 },
137]
138
139
140# Internationalization
141# https://docs.djangoproject.com/en/1.9/topics/i18n/
142
143LANGUAGE_CODE = 'en-us'
144
145TIME_ZONE = 'UTC'
146
147USE_I18N = True
148
149USE_L10N = True
150
151USE_TZ = True
152
153
154# Static files (CSS, JavaScript, Images)
155# https://docs.djangoproject.com/en/1.9/howto/static-files/
156BASE_DIR = os.path.dirname(os.path.abspath(__file__))
157STATIC_URL = '/static/'
158STATIC_ROOT = os.path.join(BASE_DIR, 'static')
159STATICFILES_DIR = (BASE_DIR, 'static')
160
161STATICFILES_FINDERS = [
162 'django.contrib.staticfiles.finders.FileSystemFinder',
163 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
164 #'django.contrib.staticfiles.finders.DefaultStorageFinder',
165]
166
167
168MEDIA_URL = '/media/'
169MEDIA_ROOT = MEDIA_DIR