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