| 1 | # Django settings for persisted project.
|
|---|
| 2 |
|
|---|
| 3 | import os
|
|---|
| 4 | PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
|
|---|
| 5 |
|
|---|
| 6 | # This variables get re-used in definitions so make sure to override them upfront
|
|---|
| 7 | DJANGO_PREFIX = '/d'
|
|---|
| 8 | OSM_PROXY_DIR = PROJECT_HOME + '/cache/osm_proxy'
|
|---|
| 9 |
|
|---|
| 10 | if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
|
|---|
| 11 | from local_settings import *
|
|---|
| 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_PROXY_CDN_DOMAINS_PROTOCOL = 'http://'
|
|---|
| 16 | OSM_PREFIX = '/osm-tile-proxy'
|
|---|
| 17 | DJANGO_CDN_DOMAINS = [d + '.maps.wirelessleiden.nl' for d in DJANGO_BALANCERS]
|
|---|
| 18 | DJANGO_CDN_DOMAINS_PROTOCOL = 'http://'
|
|---|
| 19 |
|
|---|
| 20 | DEBUG = os.path.exists(PROJECT_HOME + '/enable_debug')
|
|---|
| 21 | TEMPLATE_DEBUG = DEBUG
|
|---|
| 22 |
|
|---|
| 23 | # Required for Etags Caching Implementation
|
|---|
| 24 | USE_ETAGS = True
|
|---|
| 25 |
|
|---|
| 26 | # Please mind(!), enabling will cause it to send emails when DEBUG=False
|
|---|
| 27 | ADMINS = (
|
|---|
| 28 | # ('Rick van der Zwet', 'info@rickvanderzwet.nl'),
|
|---|
| 29 | )
|
|---|
| 30 |
|
|---|
| 31 | MANAGERS = ADMINS
|
|---|
| 32 |
|
|---|
| 33 | DATABASES = {
|
|---|
| 34 | 'default': {
|
|---|
| 35 | 'ENGINE': 'django.db.backends.mysql',
|
|---|
| 36 | 'NAME': 'project_heatmap',
|
|---|
| 37 | 'USER': 'root',
|
|---|
| 38 | 'PASSWORD': '',
|
|---|
| 39 | 'HOST': 'localhost',
|
|---|
| 40 | 'PORT': '3306',
|
|---|
| 41 | }
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | CACHES = {
|
|---|
| 45 | 'default': {
|
|---|
| 46 | 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
|---|
| 47 | 'LOCATION': '127.0.0.1:11211',
|
|---|
| 48 | 'TIMEOUT': 3600 * 24 * 7,
|
|---|
| 49 | 'OPTIONS': {
|
|---|
| 50 | 'MAX_ENTRIES': 100000
|
|---|
| 51 | }
|
|---|
| 52 | },
|
|---|
| 53 | 'osm_proxy': {
|
|---|
| 54 | 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
|
|---|
| 55 | 'LOCATION': OSM_PROXY_DIR,
|
|---|
| 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 | },
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 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/"
|
|---|
| 91 | MEDIA_ROOT = os.path.join(PROJECT_HOME,'sitemedia')
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 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/"
|
|---|
| 97 | MEDIA_URL = DJANGO_PREFIX + '/media/'
|
|---|
| 98 |
|
|---|
| 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/"
|
|---|
| 103 | STATIC_ROOT = os.path.join(PROJECT_HOME,'sitestatic')
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | # URL prefix for static files.
|
|---|
| 107 | # Example: "http://media.lawrence.com/static/"
|
|---|
| 108 | STATIC_URL = DJANGO_PREFIX + '/static/'
|
|---|
| 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/".
|
|---|
| 113 | ADMIN_MEDIA_PREFIX = DJANGO_PREFIX + '/static/admin/'
|
|---|
| 114 |
|
|---|
| 115 | # Additional locations of static files
|
|---|
| 116 | STATICFILES_DIRS = (
|
|---|
| 117 | # PROJECT_HOME + '/static',
|
|---|
| 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 |
|
|---|
| 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 = (
|
|---|
| 136 | 'django.template.loaders.filesystem.Loader',
|
|---|
| 137 | 'django.template.loaders.app_directories.Loader',
|
|---|
| 138 | 'django.template.loaders.eggs.Loader',
|
|---|
| 139 | )
|
|---|
| 140 |
|
|---|
| 141 | # XXX: MiddleWare Cache is causing sever slowdowns, wrong cache maybe, why?
|
|---|
| 142 | MIDDLEWARE_CLASSES = (
|
|---|
| 143 | # 'django.middleware.cache.UpdateCacheMiddleware',
|
|---|
| 144 | 'django.middleware.common.CommonMiddleware',
|
|---|
| 145 | # 'django.middleware.cache.FetchFromCacheMiddleware',
|
|---|
| 146 | # 'django.middleware.http.ConditionalGetMiddleware',
|
|---|
| 147 | 'django.contrib.sessions.middleware.SessionMiddleware',
|
|---|
| 148 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|---|
| 149 | )
|
|---|
| 150 |
|
|---|
| 151 | ROOT_URLCONF = 'urls'
|
|---|
| 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.
|
|---|
| 156 | # Don't forget to use absolute paths, not relative paths.
|
|---|
| 157 | os.path.join(PROJECT_HOME, 'templates'),
|
|---|
| 158 | )
|
|---|
| 159 |
|
|---|
| 160 | INSTALLED_APPS = (
|
|---|
| 161 | 'django.contrib.admin',
|
|---|
| 162 | 'django.contrib.auth',
|
|---|
| 163 | 'django.contrib.contenttypes',
|
|---|
| 164 | 'django.contrib.sessions',
|
|---|
| 165 | 'django.contrib.sites',
|
|---|
| 166 | 'django.contrib.staticfiles',
|
|---|
| 167 | 'django_extensions',
|
|---|
| 168 | 'gheat',
|
|---|
| 169 | 'wlheatmap',
|
|---|
| 170 | )
|
|---|
| 171 |
|
|---|
| 172 | # Include and custom local stuff
|
|---|
| 173 | if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
|
|---|
| 174 | from local_settings import *
|
|---|