source: src/django_gheat/settings.py@ 9586

Last change on this file since 9586 was 9586, checked in by rick, 13 years ago

Allow overwriting the DJANGO_PREFIX thingy

File size: 5.4 KB
Line 
1# Django settings for persisted project.
2
3import os
4PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
5
6DJANGO_PREFIX = '/d'
7if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
8 from local_settings import DJANGO_PREFIX
9
10DJANGO_BALANCERS = OSM_PROXY_BALANCERS = ['a','b','c','d','e','f']
11OSM_PROXY_CDN_DOMAINS = [d + '.osmproxy.wirelessleiden.nl' for d in DJANGO_BALANCERS]
12OSM_PREFIX = '/osm-tile-proxy'
13DJANGO_CDN_DOMAINS = [d + '.maps.wirelessleiden.nl' for d in DJANGO_BALANCERS]
14
15DEBUG = os.path.exists(PROJECT_HOME + '/enable_debug')
16TEMPLATE_DEBUG = DEBUG
17
18# Required for Etags Caching Implementation
19USE_ETAGS = True
20
21# Please mind(!), enabling will cause it to send emails when DEBUG=False
22ADMINS = (
23# ('Rick van der Zwet', 'info@rickvanderzwet.nl'),
24)
25
26MANAGERS = ADMINS
27
28DATABASES = {
29 'default': {
30 'ENGINE': 'django.db.backends.mysql',
31 'NAME': 'project_heatmap',
32 'USER': 'root',
33 'PASSWORD': '',
34 'HOST': 'localhost',
35 'PORT': '3306',
36 }
37}
38
39CACHES = {
40 'default': {
41 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
42 'LOCATION': '127.0.0.1:11211',
43 'TIMEOUT': 3600 * 24 * 7,
44 'OPTIONS': {
45 'MAX_ENTRIES': 100000
46 }
47 },
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 },
64}
65
66
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.
72TIME_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
76LANGUAGE_CODE = 'en-us'
77
78SITE_ID = 1
79
80# If you set this to False, Django will make some optimizations so as not
81# to load the internationalization machinery.
82USE_I18N = True
83
84# Absolute path to the directory that holds media.
85# Example: "/home/media/media.lawrence.com/"
86MEDIA_ROOT = os.path.join(PROJECT_HOME,'sitemedia')
87
88
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/"
92MEDIA_URL = DJANGO_PREFIX + '/media/'
93
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/"
98STATIC_ROOT = os.path.join(PROJECT_HOME,'sitestatic')
99
100
101# URL prefix for static files.
102# Example: "http://media.lawrence.com/static/"
103STATIC_URL = DJANGO_PREFIX + '/static/'
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/".
108ADMIN_MEDIA_PREFIX = DJANGO_PREFIX + '/static/admin/'
109
110# Additional locations of static files
111STATICFILES_DIRS = (
112 # PROJECT_HOME + '/static',
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.
120STATICFILES_FINDERS = (
121 'django.contrib.staticfiles.finders.FileSystemFinder',
122 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
123# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
124)
125
126# Make this unique, and don't share it with anybody.
127SECRET_KEY = '=wg@x19kr@26sibiaynb9ax5ddp1&yu^+$3n++^_lz1ms80syb'
128
129# List of callables that know how to import templates from various sources.
130TEMPLATE_LOADERS = (
131 'django.template.loaders.filesystem.Loader',
132 'django.template.loaders.app_directories.Loader',
133 'django.template.loaders.eggs.Loader',
134)
135
136# XXX: MiddleWare Cache is causing sever slowdowns, wrong cache maybe, why?
137MIDDLEWARE_CLASSES = (
138# 'django.middleware.cache.UpdateCacheMiddleware',
139 'django.middleware.common.CommonMiddleware',
140# 'django.middleware.cache.FetchFromCacheMiddleware',
141# 'django.middleware.http.ConditionalGetMiddleware',
142 'django.contrib.sessions.middleware.SessionMiddleware',
143 'django.contrib.auth.middleware.AuthenticationMiddleware',
144)
145
146ROOT_URLCONF = 'urls'
147
148TEMPLATE_DIRS = (
149 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
150 # Always use forward slashes, even on Windows.
151 # Don't forget to use absolute paths, not relative paths.
152 os.path.join(PROJECT_HOME, 'templates'),
153)
154
155INSTALLED_APPS = (
156 'django.contrib.admin',
157 'django.contrib.auth',
158 'django.contrib.contenttypes',
159 'django.contrib.sessions',
160 'django.contrib.sites',
161 'django.contrib.staticfiles',
162 'django_extensions',
163 'gheat',
164 'wlheatmap',
165)
166
167# Include and custom local stuff
168if os.path.isfile(PROJECT_HOME + '/local_settings.py'):
169 from local_settings import *
Note: See TracBrowser for help on using the repository browser.