1 | # Django settings for persisted project.
|
---|
2 |
|
---|
3 | import os
|
---|
4 | PROJECT_HOME = os.path.abspath(os.path.dirname(__file__))
|
---|
5 | OSM_CACHE_DIR = '/tmp/osm-cache'
|
---|
6 | OSM_CACHE = 'osm_cache'
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 | DEBUG = True
|
---|
11 | TEMPLATE_DEBUG = DEBUG
|
---|
12 |
|
---|
13 | if DEBUG and not os.path.exists(OSM_CACHE_DIR):
|
---|
14 | os.mkdir(OSM_CACHE_DIR)
|
---|
15 |
|
---|
16 | # Required for Etags Caching Implementation
|
---|
17 | USE_ETAGS = True
|
---|
18 |
|
---|
19 | ADMINS = (
|
---|
20 | ('Example Admin', 'admin@example.org'),
|
---|
21 | )
|
---|
22 |
|
---|
23 | MANAGERS = ADMINS
|
---|
24 |
|
---|
25 | DATABASES = {
|
---|
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 |
|
---|
36 | CACHES = {
|
---|
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.
|
---|
57 | TIME_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
|
---|
61 | LANGUAGE_CODE = 'en-us'
|
---|
62 |
|
---|
63 | SITE_ID = 1
|
---|
64 |
|
---|
65 | # If you set this to False, Django will make some optimizations so as not
|
---|
66 | # to load the internationalization machinery.
|
---|
67 | USE_I18N = True
|
---|
68 |
|
---|
69 | # Absolute path to the directory that holds media.
|
---|
70 | # Example: "/home/media/media.lawrence.com/"
|
---|
71 | MEDIA_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/"
|
---|
76 | MEDIA_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/".
|
---|
81 | ADMIN_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/"
|
---|
87 | STATIC_ROOT = 'sitestatic'
|
---|
88 |
|
---|
89 | # URL prefix for static files.
|
---|
90 | # Example: "http://media.lawrence.com/static/"
|
---|
91 | STATIC_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/".
|
---|
96 | ADMIN_MEDIA_PREFIX = '/static/admin/'
|
---|
97 |
|
---|
98 | # Additional locations of static files
|
---|
99 | STATICFILES_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.
|
---|
108 | STATICFILES_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.
|
---|
115 | SECRET_KEY = '=wg@x19kr@26sibiaynb9ax5ddp1&yu^+$3n++^_lz1ms80syb'
|
---|
116 |
|
---|
117 | # List of callables that know how to import templates from various sources.
|
---|
118 | TEMPLATE_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 |
|
---|
124 | MIDDLEWARE_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 |
|
---|
133 | ROOT_URLCONF = 'urls'
|
---|
134 |
|
---|
135 | TEMPLATE_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 |
|
---|
142 | INSTALLED_APPS = (
|
---|
143 | 'django.contrib.admin',
|
---|
144 | 'django.contrib.auth',
|
---|
145 | 'django.contrib.contenttypes',
|
---|
146 | 'django.contrib.sessions',
|
---|
147 | 'django.contrib.sites',
|
---|
148 | 'django.contrib.staticfiles',
|
---|
149 | 'django_extensions',
|
---|
150 | 'gheat',
|
---|
151 | 'website',
|
---|
152 | )
|
---|