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