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