1 | # Django settings for persisted project.
|
---|
2 |
|
---|
3 | import os
|
---|
4 | PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
|
---|
5 |
|
---|
6 | DJANGO_PREFIX = '/d'
|
---|
7 | if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
|
---|
8 | from local_settings import DJANGO_PREFIX
|
---|
9 |
|
---|
10 | DJANGO_BALANCERS = OSM_PROXY_BALANCERS = ['a','b','c','d','e','f']
|
---|
11 | OSM_PROXY_CDN_DOMAINS = [d + '.osmproxy.wirelessleiden.nl' for d in DJANGO_BALANCERS]
|
---|
12 | OSM_PREFIX = '/osm-tile-proxy'
|
---|
13 | DJANGO_CDN_DOMAINS = [d + '.maps.wirelessleiden.nl' for d in DJANGO_BALANCERS]
|
---|
14 |
|
---|
15 | DEBUG = os.path.exists(PROJECT_HOME + '/enable_debug')
|
---|
16 | TEMPLATE_DEBUG = DEBUG
|
---|
17 |
|
---|
18 | # Required for Etags Caching Implementation
|
---|
19 | USE_ETAGS = True
|
---|
20 |
|
---|
21 | # Please mind(!), enabling will cause it to send emails when DEBUG=False
|
---|
22 | ADMINS = (
|
---|
23 | # ('Rick van der Zwet', 'info@rickvanderzwet.nl'),
|
---|
24 | )
|
---|
25 |
|
---|
26 | MANAGERS = ADMINS
|
---|
27 |
|
---|
28 | DATABASES = {
|
---|
29 | 'default': {
|
---|
30 | 'ENGINE': 'django.db.backends.mysql',
|
---|
31 | 'NAME': 'project_heatmap',
|
---|
32 | 'USER': 'root',
|
---|
33 | 'PASSWORD': '',
|
---|
34 | 'HOST': 'localhost',
|
---|
35 | 'PORT': '3306',
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | CACHES = {
|
---|
40 | 'default': {
|
---|
41 | 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
---|
42 | 'LOCATION': '127.0.0.1:11211',
|
---|
43 | 'TIMEOUT': 3600 * 24 * 7,
|
---|
44 | 'OPTIONS': {
|
---|
45 | 'MAX_ENTRIES': 100000
|
---|
46 | }
|
---|
47 | },
|
---|
48 | 'osm_proxy': {
|
---|
49 | 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
|
---|
50 | 'LOCATION': '/usr/local/var/django/cache/osm_proxy',
|
---|
51 | 'TIMEOUT': 3600 * 24 * 7,
|
---|
52 | 'OPTIONS': {
|
---|
53 | 'MAX_ENTRIES': 100000
|
---|
54 | }
|
---|
55 | },
|
---|
56 | 'tile_cache': {
|
---|
57 | 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
|
---|
58 | 'LOCATION': '/usr/local/var/django/cache/tile_cache',
|
---|
59 | 'TIMEOUT': 3600 * 24,
|
---|
60 | 'OPTIONS': {
|
---|
61 | 'MAX_ENTRIES': 100000
|
---|
62 | }
|
---|
63 | },
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | # Local time zone for this installation. Choices can be found here:
|
---|
68 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
---|
69 | # although not all choices may be available on all operating systems.
|
---|
70 | # If running in a Windows environment this must be set to the same as your
|
---|
71 | # system time zone.
|
---|
72 | TIME_ZONE = 'America/Chicago'
|
---|
73 |
|
---|
74 | # Language code for this installation. All choices can be found here:
|
---|
75 | # http://www.i18nguy.com/unicode/language-identifiers.html
|
---|
76 | LANGUAGE_CODE = 'en-us'
|
---|
77 |
|
---|
78 | SITE_ID = 1
|
---|
79 |
|
---|
80 | # If you set this to False, Django will make some optimizations so as not
|
---|
81 | # to load the internationalization machinery.
|
---|
82 | USE_I18N = True
|
---|
83 |
|
---|
84 | # Absolute path to the directory that holds media.
|
---|
85 | # Example: "/home/media/media.lawrence.com/"
|
---|
86 | MEDIA_ROOT = os.path.join(PROJECT_HOME,'sitemedia')
|
---|
87 |
|
---|
88 |
|
---|
89 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
---|
90 | # trailing slash if there is a path component (optional in other cases).
|
---|
91 | # Examples: "http://media.lawrence.com", "http://example.com/media/"
|
---|
92 | MEDIA_URL = DJANGO_PREFIX + '/media/'
|
---|
93 |
|
---|
94 | # Absolute path to the directory static files should be collected to.
|
---|
95 | # Don't put anything in this directory yourself; store your static files
|
---|
96 | # in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
---|
97 | # Example: "/home/media/media.lawrence.com/static/"
|
---|
98 | STATIC_ROOT = os.path.join(PROJECT_HOME,'sitestatic')
|
---|
99 |
|
---|
100 |
|
---|
101 | # URL prefix for static files.
|
---|
102 | # Example: "http://media.lawrence.com/static/"
|
---|
103 | STATIC_URL = DJANGO_PREFIX + '/static/'
|
---|
104 |
|
---|
105 | # URL prefix for admin static files -- CSS, JavaScript and images.
|
---|
106 | # Make sure to use a trailing slash.
|
---|
107 | # Examples: "http://foo.com/static/admin/", "/static/admin/".
|
---|
108 | ADMIN_MEDIA_PREFIX = DJANGO_PREFIX + '/static/admin/'
|
---|
109 |
|
---|
110 | # Additional locations of static files
|
---|
111 | STATICFILES_DIRS = (
|
---|
112 | # PROJECT_HOME + '/static',
|
---|
113 | # Put strings here, like "/home/html/static" or "C:/www/django/static".
|
---|
114 | # Always use forward slashes, even on Windows.
|
---|
115 | # Don't forget to use absolute paths, not relative paths.
|
---|
116 | )
|
---|
117 |
|
---|
118 | # List of finder classes that know how to find static files in
|
---|
119 | # various locations.
|
---|
120 | STATICFILES_FINDERS = (
|
---|
121 | 'django.contrib.staticfiles.finders.FileSystemFinder',
|
---|
122 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
---|
123 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
---|
124 | )
|
---|
125 |
|
---|
126 | # Make this unique, and don't share it with anybody.
|
---|
127 | SECRET_KEY = '=wg@x19kr@26sibiaynb9ax5ddp1&yu^+$3n++^_lz1ms80syb'
|
---|
128 |
|
---|
129 | # List of callables that know how to import templates from various sources.
|
---|
130 | TEMPLATE_LOADERS = (
|
---|
131 | 'django.template.loaders.filesystem.Loader',
|
---|
132 | 'django.template.loaders.app_directories.Loader',
|
---|
133 | 'django.template.loaders.eggs.Loader',
|
---|
134 | )
|
---|
135 |
|
---|
136 | # XXX: MiddleWare Cache is causing sever slowdowns, wrong cache maybe, why?
|
---|
137 | MIDDLEWARE_CLASSES = (
|
---|
138 | # 'django.middleware.cache.UpdateCacheMiddleware',
|
---|
139 | 'django.middleware.common.CommonMiddleware',
|
---|
140 | # 'django.middleware.cache.FetchFromCacheMiddleware',
|
---|
141 | # 'django.middleware.http.ConditionalGetMiddleware',
|
---|
142 | 'django.contrib.sessions.middleware.SessionMiddleware',
|
---|
143 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
---|
144 | )
|
---|
145 |
|
---|
146 | ROOT_URLCONF = 'urls'
|
---|
147 |
|
---|
148 | TEMPLATE_DIRS = (
|
---|
149 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
---|
150 | # Always use forward slashes, even on Windows.
|
---|
151 | # Don't forget to use absolute paths, not relative paths.
|
---|
152 | os.path.join(PROJECT_HOME, 'templates'),
|
---|
153 | )
|
---|
154 |
|
---|
155 | INSTALLED_APPS = (
|
---|
156 | 'django.contrib.admin',
|
---|
157 | 'django.contrib.auth',
|
---|
158 | 'django.contrib.contenttypes',
|
---|
159 | 'django.contrib.sessions',
|
---|
160 | 'django.contrib.sites',
|
---|
161 | 'django.contrib.staticfiles',
|
---|
162 | 'django_extensions',
|
---|
163 | 'gheat',
|
---|
164 | 'wlheatmap',
|
---|
165 | )
|
---|
166 |
|
---|
167 | # Include and custom local stuff
|
---|
168 | if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
|
---|
169 | from local_settings import *
|
---|