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