forked from UKPythonAssociation/community.uk.python.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
141 lines (96 loc) · 3.25 KB
/
Copy pathsettings.py
File metadata and controls
141 lines (96 loc) · 3.25 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
"""
Django settings for ukpython project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# 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/1.10/howto/deployment/checklist/
# This does not need to be kept secret, since it is not used to protect
# anything in the static site.
SECRET_KEY = 'secret'
# SECURITY WARNING: This should be False when the site is built to ensure we
# don't accidentally leak information in error pages. This has the added
# effect of massively speeding up the build, since LESS compilation no longer
# happens on every request!
DEBUG = bool(os.getenv('DEBUG', False))
# This is fine.
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'ukpython',
'django_amber',
'markdown_deux',
'compressor',
# These two apps are required for Django to work properly, even though we
# don't use them directly.
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.staticfiles',
]
MIDDLEWARE_CLASSES = [
]
ROOT_URLCONF = 'ukpython.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'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 = 'ukpython.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE = 'en-gb'
TIME_ZONE = 'UTC'
USE_TZ = True
# Formatting
DATE_FORMAT = 'jS F Y' # eg 25th December 2016
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'media')
]
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
# Markdown
MARKDOWN_DEUX_STYLES = {
'default': {
'safe_mode': False, # This means we don't escape HTML tags in Markdown
}
}
# Django Amber
DJANGO_AMBER_CNAME = 'uk.python.org'
# Django Compressor
COMPRESS_PRECOMPILERS = (
('text/less', 'lessc {infile} {outfile}'),
)
# API key for retrieving events from meetup.com
# See https://secure.meetup.com/meetup_api/key/.
MEETUP_API_KEY = os.getenv('MEETUP_API_KEY', None)