public
Description: DjangoHQ is a (hand-driven) aggregator for django related news.
Homepage: http://www.djangohq.de/
Clone URL: git://github.com/bartTC/djangohq.git
djangohq / settings.py
100644 170 lines (135 sloc) 5.104 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
import os
import sys
 
PROJECT_ROOT = os.path.dirname(__file__)
 
sys.path.append('/srv/packages/lib/')
sys.path.append(os.path.join(PROJECT_ROOT, 'apps'))
 
# ##############################################################################
# App specific settings
# ##############################################################################
 
# Comments
COMMENT_MAX_LENGTH = 3200
COMMENT_NAME_MAX_LENGTH = 50
COMMENT_USERNAME_MAX_WORD_LENGTH = 20
 
# Tagging
FORCE_LOWERCASE_TAGS = True
 
# Registration
ACCOUNT_ACTIVATION_DAYS = 3
ACCOUNT_DEFAULT_PERMISSONS = ('add_entry', 'change_entry')
 
LOGIN_REDIRECT_URL = "/"
 
TEMPLATECOMPONENTS_PATH_TO_YUICOMPRESSOR_JAR = os.path.join(PROJECT_ROOT, 'site_media', 'yuicompressor-2.3.5.jar')
TEMPLATECOMPONENTS_COMPRESS_JAVASCRIPT = True
TEMPLATECOMPONENTS_COMPRESS_CSS = True
 
# ##############################################################################
# Debug and Mail-Settings
# ##############################################################################
 
DEBUG = True
TEMPLATE_DEBUG = DEBUG
 
ADMINS = (
# ('Martin Mahner', 'martin@mahner.org'),
)
 
MANAGERS = ADMINS
 
USE_ETAGS = True
APPEND_SLASH = True
 
EMAIL_HOST = 'localhost'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
 
# ##############################################################################
# Application and Middleware Settings
# ##############################################################################
 
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    # Ext
    #'sorl.thumbnail',
    'registration',
    'tagging',
    'rosetta',
    'pagination',
    # Self
    'accounts',
    'weblog',
    'comments',
 
)
 
AUTH_PROFILE_MODULE = 'accounts.profile'
 
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',
    'djangohq.context_processors.auth',
    'djangohq.context_processors.road_to_10',
    'weblog.context_processors.popular',
)
 
MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.middleware.http.ConditionalGetMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.gzip.GZipMiddleware',
    'pagination.middleware.PaginationMiddleware',
)
 
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)
 
TEMPLATE_DIRS = (
    os.path.join(PROJECT_ROOT, 'templates'),
)
 
 
# ##############################################################################
# Database Settings
# ##############################################################################
 
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
 
 
# ##############################################################################
# Language and I18N
# ##############################################################################
USE_I18N = True
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'de'
LANGUAGES = (
    ('de', 'German'),
)
 
INTERNAL_IPS = ('127.0.0.1',)
 
 
# ##############################################################################
# URL and Path Settings
# ##############################################################################
 
SITE_ID = 1
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media')
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/admin_media/'
ROOT_URLCONF = 'djangohq.urls'
 
 
# ##############################################################################
# Secret Key
# Make this unique, and don't share it with anybody.
# ##############################################################################
try:
    SECRET_KEY
except NameError:
    SECRET_FILE = os.path.join(PROJECT_ROOT, '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)
 
try:
    from local_settings import *
except ImportError:
    pass