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