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