source: src/django_gheat/settings.py@ 9565

Last change on this file since 9565 was 9549, checked in by rick, 13 years ago
  • Caches are now fully-file based as memcached was not working well with large entries (like images).
  • OSM django proxy is way to slow, rewrite to use apache balanced proxy members.
  • Use HTTPD mod_cache to cache heavy image generation work.
File size: 5.1 KB
RevLine 
[9041]1# Django settings for persisted project.
2
3import os
[9189]4PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
[9372]5
[9544]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]
[9549]9OSM_PREFIX = '/osm-tile-proxy'
[9544]10DJANGO_CDN_DOMAINS = [d + '.maps.wirelessleiden.nl' for d in DJANGO_BALANCERS]
11
[9385]12DEBUG = os.path.exists(PROJECT_HOME + '/enable-debug')
[9041]13TEMPLATE_DEBUG = DEBUG
14
[9188]15# Required for Etags Caching Implementation
16USE_ETAGS = True
17
[9394]18# Please mind(!), enabling will cause it to send emails when DEBUG=False
[9041]19ADMINS = (
[9394]20# ('Rick van der Zwet', 'info@rickvanderzwet.nl'),
[9041]21)
22
23MANAGERS = ADMINS
24
25DATABASES = {
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]36CACHES = {
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.
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/"
[9395]83MEDIA_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]89MEDIA_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]95STATIC_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]100STATIC_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/".
[9545]105ADMIN_MEDIA_PREFIX = '/d/static/admin/'
[9139]106
107# Additional locations of static files
108STATICFILES_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.
117STATICFILES_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.
124SECRET_KEY = '=wg@x19kr@26sibiaynb9ax5ddp1&yu^+$3n++^_lz1ms80syb'
125
126# List of callables that know how to import templates from various sources.
127TEMPLATE_LOADERS = (
[9389]128 'django.template.loaders.filesystem.Loader',
129 'django.template.loaders.app_directories.Loader',
130 'django.template.loaders.eggs.Loader',
[9041]131)
132
133MIDDLEWARE_CLASSES = (
[9188]134 'django.middleware.cache.UpdateCacheMiddleware',
[9358]135 'django.middleware.common.CommonMiddleware',
136 'django.middleware.cache.FetchFromCacheMiddleware',
137 'django.middleware.http.ConditionalGetMiddleware',
[9041]138 'django.contrib.sessions.middleware.SessionMiddleware',
139 'django.contrib.auth.middleware.AuthenticationMiddleware',
140)
141
[9139]142ROOT_URLCONF = 'urls'
[9041]143
144TEMPLATE_DIRS = (
145 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
146 # Always use forward slashes, even on Windows.
[9051]147 # Don't forget to use absolute paths, not relative paths.
[9041]148 os.path.join(PROJECT_HOME, 'templates'),
149)
150
151INSTALLED_APPS = (
[9051]152 'django.contrib.admin',
[9041]153 'django.contrib.auth',
154 'django.contrib.contenttypes',
155 'django.contrib.sessions',
156 'django.contrib.sites',
[9358]157 'django.contrib.staticfiles',
[9041]158 'django_extensions',
[9139]159 'gheat',
[9376]160 'wlheatmap',
[9041]161)
Note: See TracBrowser for help on using the repository browser.