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