source: src/django_gheat/settings.py@ 9568

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

Ehm, this cache is a not_so_happy cache..

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