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