Byteflow Blog Engine

view settings.py @ 915:8b5437fb248a

Fix for signals refactoring
author Alexander Solovyov <piranha@piranha.org.ua>
date Thu Aug 14 11:12:23 2008 +0300 (3 months ago)
parents f1e29226475e
children 98f84942cd07
line source
1# -*- encoding: utf-8 -*-
2
3#
4# DO NOT EDIT THIS FILE!
5#
6# If you want to make your own changes, do them in settings_local.py. All
7# variables set in the settings_local.py will override corresponding values from
8# settings.py
9#
10
11import os.path
12import sys
13
14PROJECT_ROOT = os.path.dirname(__file__)
15
16sys.path.insert(0, os.path.join(PROJECT_ROOT, 'apps'))
17sys.path.insert(0, os.path.join(PROJECT_ROOT, 'compat'))
18
19DEBUG = True
20TEMPLATE_DEBUG = DEBUG
21
22# Possible choices are: ''|'simple'|'recaptcha'
23# To utilize recaptcha you must get public/private keys
24# from http://recaptcha.net/
25CAPTCHA='simple'
26RECAPTCHA_PUBLIC_KEY = ''
27RECAPTCHA_PRIVATE_KEY =''
28
29
30ADMINS = (
31 # ('Your Name', 'your_email@domain.com'),
32)
33
34MANAGERS = ADMINS
35
36# Local time zone for this installation. All choices can be found here:
37# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
38TIME_ZONE = 'Europe/Kiev'
39
40# Language code for this installation. All choices can be found here:
41# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
42# http://blogs.law.harvard.edu/tech/stories/storyReader$15
43LANGUAGE_CODE = 'en-us'
44
45SITE_ID = 1
46
47# If you set this to False, Django will make some optimizations so as not
48# to load the internationalization machinery.
49USE_I18N = True
50
51# Absolute path to the directory that holds media.
52# Example: "/home/media/media.lawrence.com/"
53MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
54STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
55
56# URL that handles the media served from MEDIA_ROOT.
57# Example: "http://media.lawrence.com"
58MEDIA_URL = '/media/'
59STATIC_URL = '/static/'
60
61# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
62# trailing slash.
63# Examples: "http://foo.com/media/", "/media/".
64ADMIN_MEDIA_PREFIX = '/admin-media/'
65
66# Don't share it with anybody
67if not hasattr(globals(), 'SECRET_KEY'):
68 SECRET_FILE = os.path.join(PROJECT_ROOT, 'secret.txt')
69 try:
70 SECRET_KEY = open(SECRET_FILE).read().strip()
71 except IOError:
72 try:
73 from random import choice
74 SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
75 secret = file(SECRET_FILE, 'w')
76 secret.write(SECRET_KEY)
77 secret.close()
78 except IOError:
79 raise Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)
80
81# List of callables that know how to import templates from various sources.
82TEMPLATE_LOADERS = (
83 'lib.template_loaders.get_theme_template',
84 'django.template.loaders.filesystem.load_template_source',
85 'django.template.loaders.app_directories.load_template_source',
86# 'django.template.loaders.eggs.load_template_source',
87)
88
89MIDDLEWARE_CLASSES = (
90 'django.middleware.common.CommonMiddleware',
91 'lib.threadlocals.ThreadLocalsMiddleware',
92 'django.contrib.sessions.middleware.SessionMiddleware',
93 'middleware.url.UrlMiddleware',
94 'django.middleware.locale.LocaleMiddleware',
95 'django.contrib.auth.middleware.AuthenticationMiddleware',
96 'middleware.redirect.RedirectMiddleware',
97 'openidconsumer.middleware.OpenIDMiddleware',
98 'django.middleware.doc.XViewMiddleware',
99 'middleware.ajax_errors.AjaxMiddleware',
100 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
101)
102
103TEMPLATE_CONTEXT_PROCESSORS = [
104 "django.core.context_processors.auth",
105 "django.core.context_processors.debug",
106 "django.core.context_processors.i18n",
107 "django.core.context_processors.media",
108 "django.core.context_processors.request",
109 "context_processors.settings_vars",
110]
111
112AUTHENTICATION_BACKENDS = (
113 'django.contrib.auth.backends.ModelBackend',
114 'accounts.backends.CommentApprovingBackend',
115 'accounts.backends.EmailBackend',
116 'openidconsumer.backend.OpenidBackend',
117)
118
119ROOT_URLCONF = 'urls'
120
121TEMPLATE_DIRS = (
122 os.path.join(PROJECT_ROOT, 'templates'),
123)
124
125INSTALLED_APPS = (
126 'django.contrib.auth',
127 'django.contrib.contenttypes',
128 'django.contrib.sessions',
129 'django.contrib.sites',
130 'django.contrib.admin',
131 'django.contrib.sitemaps',
132 'django.contrib.flatpages',
133 'django.contrib.markup',
134 'lib',
135 'pytils',
136 'accounts',
137 'blog',
138 'discussion',
139 'openidconsumer',
140 'pingback',
141 'tagging',
142 'typogrify',
143 'render',
144 'robots',
145 'textblocks',
146 'livejournal',
147 'blogroll',
148 'openidserver',
149 'recaptcha',
150 'debug',
151 'sape',
152 'watchlist',
153)
154
155APPEND_SLASH = False
156REMOVE_WWW = True
157SITE_PROTOCOL = 'http'
158THEME = 'default'
159
160# App settings
161PAGINATE_BY = 10
162NAME_LENGTH = 256
163DATE_FORMAT = "j.m.Y"
164TIME_FORMAT = "G:i"
165ACTION_RECORD_DAYS = 3
166# Set to integer value to close comments after this number of days
167COMMENTS_EXPIRE_DAYS = None
168
169# Tagging
170FORCE_LOWERCASE_TAGS = True
171
172# OpenID
173OPENID_WITH_AUTH = True
174OPENID_REDIRECT_NEXT = '/'
175
176# Pingback
177ENABLE_PINGBACK = True
178PINGBACK_SERVER = {
179 'post_detail': 'pingback.getters.post_get',
180 }
181PINGBACK_RESPONSE_LENGTH = 200
182
183# Blogs directory ping
184ENABLE_DIRECTORY_PING = False
185# TODO: move this list to DB
186DIRECTORY_URLS = (
187 'http://ping.blogs.yandex.ru/RPC2',
188 'http://rpc.technorati.com/rpc/ping',
189 )
190
191# Default markup language for you posts. Choices are bbcode, text, html, markdown
192RENDER_METHOD = 'markdown'
193
194# Gravatar options
195GRAVATAR_ENABLE = False
196DEFAULT_AVATAR_IMG = 'avatar.jpg'
197DEFAULT_AVATAR_SIZE = 80
198DEFAULT_AVATAR_PATH = MEDIA_URL + 'avatars/'
199
200#if "false" robots application would not use auto-generated sitemap.xml
201ROBOTS_USE_SITEMAP = True
202
203# Root urlconf component for all blog urls
204BLOG_URLCONF_ROOT = 'blog/' # Don't forget that there must be no leading '/'
205SET_URL_ROOT_HANDLER = True # Process or not process url '/', usable for flatpages
206
207# Some defaults
208APPEND_MTIME_TO_STATIC = True # Modification time will be appended in media_css and media_js templatetags
209WYSIWYG_ENABLE = False # WYSIWYG for post text in admin
210ANONYMOUS_COMMENTS_APPROVED = False # Do anonymous comments become autoapproved?
211CAPTCHA_ENABLED = ANONYMOUS_COMMENTS_APPROVED # Enable captcha?
212DEBUG_SQL = False # Show debug information about sql queries at the bottom of page
213ENABLE_IMPORT = False # Enable importers
214ENABLE_LJ_CROSSPOST = False # Disable by defauls
215SHORT_POSTS_IN_FEED = False # Show full post in feed
216ENABLE_SAPE = False # Disable 'sape.ru' client
217USE_ATOM = True # Atom is standard, so we're using it by default
218
219STATIC_PAGES = (
220 # Name, url, title. When bool(name) is False, separator will be inserted
221 ('Blog', '/%s' % BLOG_URLCONF_ROOT, ''),
222 )
223
224# See all choices in apps/blog/templatetags/bookmarks.py
225SOCIAL_BOOKMARKS = ('delicious', 'reddit', 'slashdot', 'digg', 'technorati', 'google')
226
227try:
228 from settings_local import *
229except ImportError:
230 import sys
231 sys.stderr.write('Unable to read settings_local.py\n')
232 sys.exit(1)
233
234if ENABLE_IMPORT:
235 INSTALLED_APPS += ('wpimport', )
236
237#if ENABLE_SAPE:
238 #INSTALLED_APPS += ('sape', )
239
240if 'ADDITIONAL_APPS' in locals():
241 INSTALLED_APPS = INSTALLED_APPS + locals()['ADDITIONAL_APPS']
242
243LOCALE_PATHS = (os.path.join(PROJECT_ROOT, 'locale'), )
244THEME_STATIC_URL = os.path.join(STATIC_URL, THEME + '/')
245
246if DEBUG:
247 MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('middleware.profile.ProfilerMiddleware', )