source: src/django_gheat/settings.py@ 9368

Last change on this file since 9368 was 9368, checked in by rick, 14 years ago

Disable debugging by default, causing it to flow much faster. If the file debug-active is found, it is enabled again.

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