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