source: src/django_gheat/settings.py@ 9189

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

Avoid hitting the OSM website all the time, use local caching. Makes development more easy as well.

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