public
Description: k9 is a complete Django based Project for my k9 rescue dog unit. See Wiki for details.
Homepage: http://www.rettungshunde-stralsund.de/
Clone URL: git://github.com/bartTC/k9.git
k9 / settings.py
100644 183 lines (148 sloc) 6.111 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# -*- coding: utf-8 -*-
import os
 
WORKPATH = os.path.dirname(os.path.abspath(__file__))
 
#===============================================================================
# App specific settings
#===============================================================================
 
# The initial password (user reminder)
INITIAL_PASSWORD = 'my-super-secret-inital-password'
 
# Your Google Maps API Key for your domain
GOOGLE_MAPS_API_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
# Your Askimet API-Key
ASKIMET_API_KEY = 'ABCDEFG'
 
# Set to 'False' if you do NOT want to check new comments against Askimet
COMMENTS_CHECK_ASKIMET = False
 
# Set to 'False' if you do NOT want do save Spam-Comments
# Usually this is false, set this to 'True' if you think, you
# get to many false-positives.
COMMENTS_SAVE_SPAM = False
 
# Max characters allowed in comments
COMMENT_CONTENT_MAX_LENGTH = 1200
 
# Blacklisted words in comments
# This must be tuple or a list. You can either specify strings or pre-compiled
# regular expressions. See the example for more information:
#
# Example:
# from re import compile
# COMMENT_DISALLOWED_KEYWORDS = (
# 'Viagra', # Fetches 'Viagra' but not 'VIAGRA' or 'ViAGra'
# compile('vi[a|4]?gra'), # Fetches 'viagra' or 'vi4gra'
# )
 
COMMENT_DISALLOWED_KEYWORDS = (
    'URL=', # BBCode Links are not allowed
    'casino', # Nobody here wants to gamble
    'Casino',
)
 
#===============================================================================
# Debug and E-Mail settings
#===============================================================================
 
DEBUG = True
TEMPLATE_DEBUG = DEBUG
 
ADMINS = (
    #('Your Name', 'your.email@example.com'),
)
MANAGERS = ADMINS
 
#===============================================================================
# Cache Settings
#===============================================================================
 
CACHE_BACKEND = 'db://cache/?timeout=3600'
CACHE_MIDDLEWARE_SECONDS = 3600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
 
#===============================================================================
# Database settings
#===============================================================================
 
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'dev.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
 
#===============================================================================
# I18N
#===============================================================================
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'de'
SITE_ID = 1
USE_I18N = True
 
ROOT_URLCONF = 'k9.urls'
 
#===============================================================================
# Media-Root
#===============================================================================
MEDIA_ROOT = os.path.join(WORKPATH, 'site_media')
 
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'
 
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/admin_media/'
 
# Path for static files
WEB_ROOT = os.path.join(WORKPATH, 'static_cache/htdocs')
 
#===============================================================================
# Secret Key
# Make this unique, and don't share it with anybody.
#===============================================================================
 
try:
    SECRET_KEY
except NameError:
    SECRET_FILE = os.path.join(WORKPATH, 'secret.txt')
    try:
        SECRET_KEY = open(SECRET_FILE).read().strip()
    except IOError:
        try:
            from random import choice
            SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
            secret = file(SECRET_FILE, 'w')
            secret.write(SECRET_KEY)
            secret.close()
        except IOError:
            Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)
 
#===============================================================================
# Installed Apps
#===============================================================================
 
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.humanize',
    'k9.apps.member',
    'k9.apps.events',
    'k9.apps.gallery',
    'k9.apps.links',
    'k9.apps.news',
    'k9.apps.pages',
)
 
AUTH_PROFILE_MODULE = 'member.Member'
 
#===============================================================================
# Processors and Loaders
#===============================================================================
 
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
 
MIDDLEWARE_CLASSES = (
    'django.middleware.gzip.GZipMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'k9.middleware.CachePurgeMiddleware',
# 'django.middleware.cache.CacheMiddleware',
    'django.middleware.doc.XViewMiddleware',
)
 
TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    "django.core.context_processors.debug",
    "k9.context_processors.link_categories",
)
 
TEMPLATE_DIRS = [os.path.join(WORKPATH, 'templates')]
 
# Import local settings
try:
    from settings_secrets import *
except ImportError:
    pass