2
by Janos Gyerik
added most base files, nothing visible yet |
1 |
# Django settings for bashoneliners project.
|
2 |
||
3 |
import os |
|
4 |
DIRNAME = os.path.abspath(os.path.dirname(__file__)) |
|
5 |
||
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
6 |
DEBUG = False |
2
by Janos Gyerik
added most base files, nothing visible yet |
7 |
DEBUG = True |
8 |
TEMPLATE_DEBUG = DEBUG |
|
9 |
||
10 |
ADMINS = ( |
|
314
by Janos Gyerik
maybe now login page is really valid html5 |
11 |
('Bash One-Liners DEV', 'info@bashoneliners.com'), |
2
by Janos Gyerik
added most base files, nothing visible yet |
12 |
)
|
13 |
||
14 |
MANAGERS = ADMINS |
|
15 |
||
16 |
DATABASES = { |
|
17 |
'default': { |
|
378
by Janos Gyerik
minor bugfix, and updated settings sample |
18 |
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
2
by Janos Gyerik
added most base files, nothing visible yet |
19 |
'NAME': 'sqlite3.db', # Or path to database file if using sqlite3. |
20 |
'USER': '', # Not used with sqlite3. |
|
21 |
'PASSWORD': '', # Not used with sqlite3. |
|
22 |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
|
23 |
'PORT': '', # Set to empty string for default. Not used with sqlite3. |
|
24 |
}
|
|
25 |
}
|
|
26 |
||
27 |
# Local time zone for this installation. Choices can be found here:
|
|
28 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
29 |
# although not all choices may be available on all operating systems.
|
|
30 |
# On Unix systems, a value of None will cause Django to use the same
|
|
31 |
# timezone as the operating system.
|
|
32 |
# If running in a Windows environment this must be set to the same as your
|
|
33 |
# system time zone.
|
|
34 |
TIME_ZONE = 'Europe/Paris' |
|
35 |
||
36 |
# Language code for this installation. All choices can be found here:
|
|
37 |
# http://www.i18nguy.com/unicode/language-identifiers.html
|
|
38 |
LANGUAGE_CODE = 'en-us' |
|
39 |
||
40 |
SITE_ID = 1 |
|
41 |
||
42 |
# If you set this to False, Django will make some optimizations so as not
|
|
43 |
# to load the internationalization machinery.
|
|
44 |
USE_I18N = True |
|
45 |
||
46 |
# If you set this to False, Django will not format dates, numbers and
|
|
47 |
# calendars according to the current locale
|
|
48 |
USE_L10N = True |
|
49 |
||
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
50 |
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
51 |
# Example: "/home/media/media.lawrence.com/media/"
|
|
52 |
MEDIA_ROOT = os.path.join(DIRNAME, 'www') |
|
2
by Janos Gyerik
added most base files, nothing visible yet |
53 |
|
54 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
55 |
# trailing slash.
|
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
56 |
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
57 |
MEDIA_URL = '' |
|
58 |
||
59 |
# Absolute path to the directory static files should be collected to.
|
|
60 |
# Don't put anything in this directory yourself; store your static files
|
|
61 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
|
62 |
# Example: "/home/media/media.lawrence.com/static/"
|
|
63 |
STATIC_ROOT = '' |
|
64 |
||
65 |
# URL prefix for static files.
|
|
66 |
# Example: "http://media.lawrence.com/static/"
|
|
67 |
STATIC_URL = '/media/' |
|
68 |
||
69 |
# URL prefix for admin static files -- CSS, JavaScript and images.
|
|
70 |
# Make sure to use a trailing slash.
|
|
71 |
# Examples: "http://foo.com/static/admin/", "/static/admin/".
|
|
72 |
ADMIN_MEDIA_PREFIX = '/media/admin/' |
|
73 |
||
74 |
# Additional locations of static files
|
|
75 |
STATICFILES_DIRS = ( |
|
76 |
# Put strings here, like "/home/html/static" or "C:/www/django/static".
|
|
77 |
# Always use forward slashes, even on Windows.
|
|
78 |
# Don't forget to use absolute paths, not relative paths.
|
|
79 |
os.path.join(DIRNAME, 'media'), |
|
80 |
)
|
|
81 |
||
82 |
# List of finder classes that know how to find static files in
|
|
83 |
# various locations.
|
|
84 |
STATICFILES_FINDERS = ( |
|
85 |
'django.contrib.staticfiles.finders.FileSystemFinder', |
|
86 |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
87 |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
|
88 |
)
|
|
2
by Janos Gyerik
added most base files, nothing visible yet |
89 |
|
90 |
# Make this unique, and don't share it with anybody.
|
|
91 |
SECRET_KEY = '06@udwbt7b*dxb2cpq+ly8b1kn-(5bb2jae949%*yz48t-$+dm' |
|
92 |
||
93 |
# List of callables that know how to import templates from various sources.
|
|
94 |
TEMPLATE_LOADERS = ( |
|
95 |
'django.template.loaders.filesystem.Loader', |
|
96 |
'django.template.loaders.app_directories.Loader', |
|
97 |
# 'django.template.loaders.eggs.Loader',
|
|
98 |
)
|
|
99 |
||
100 |
MIDDLEWARE_CLASSES = ( |
|
101 |
'django.middleware.common.CommonMiddleware', |
|
102 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
103 |
'django.middleware.csrf.CsrfViewMiddleware', |
|
104 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
105 |
'django.contrib.messages.middleware.MessageMiddleware', |
|
106 |
)
|
|
107 |
||
389
by Janos Gyerik
a small fix in the sample settings |
108 |
AUTH_PROFILE_MODULE = 'oneliners.models.HackerProfile' |
108
by Janos Gyerik
made openid login the only login method |
109 |
|
383
by Janos Gyerik
removed openid try pass hacks (openid is required, period) |
110 |
AUTHENTICATION_BACKENDS = ( |
111 |
'django_openid_auth.auth.OpenIDBackend', |
|
112 |
'django.contrib.auth.backends.ModelBackend', |
|
113 |
)
|
|
76
by Janos Gyerik
implemented primitive openid support with no nice user interface yet |
114 |
|
115 |
OPENID_CREATE_USERS = True |
|
116 |
OPENID_UPDATE_DETAILS_FROM_SREG = True |
|
117 |
||
118 |
LOGIN_URL = '/openid/login/' |
|
108
by Janos Gyerik
made openid login the only login method |
119 |
LOGIN_REDIRECT_URL = '/main/profile' |
76
by Janos Gyerik
implemented primitive openid support with no nice user interface yet |
120 |
|
385
by Janos Gyerik
bugfix in sample settings |
121 |
ROOT_URLCONF = 'urls' |
2
by Janos Gyerik
added most base files, nothing visible yet |
122 |
|
123 |
TEMPLATE_DIRS = ( |
|
124 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
|
125 |
# Always use forward slashes, even on Windows.
|
|
126 |
# Don't forget to use absolute paths, not relative paths.
|
|
175
by Janos Gyerik
minor fix: use absolute paths in settings.TEMPLATE_DIRS |
127 |
os.path.join(DIRNAME, 'templates'), |
2
by Janos Gyerik
added most base files, nothing visible yet |
128 |
)
|
129 |
||
130 |
INSTALLED_APPS = ( |
|
131 |
'django.contrib.auth', |
|
132 |
'django.contrib.contenttypes', |
|
133 |
'django.contrib.sessions', |
|
134 |
'django.contrib.sites', |
|
135 |
'django.contrib.messages', |
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
136 |
'django.contrib.staticfiles', |
2
by Janos Gyerik
added most base files, nothing visible yet |
137 |
'django.contrib.admin', |
138 |
'django.contrib.admindocs', |
|
234
by Janos Gyerik
use markdown instead of homebrew nst for formatting explanation and limitations texts |
139 |
'django.contrib.markup', |
294
by Janos Gyerik
basic implementation of comments |
140 |
'django.contrib.comments', |
383
by Janos Gyerik
removed openid try pass hacks (openid is required, period) |
141 |
'django_openid_auth', |
142 |
'oneliners', |
|
2
by Janos Gyerik
added most base files, nothing visible yet |
143 |
)
|
144 |
||
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
145 |
# A sample logging configuration. The only tangible logging
|
146 |
# performed by this configuration is to send an email to
|
|
147 |
# the site admins on every HTTP 500 error.
|
|
148 |
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
|
149 |
# more details on how to customize your logging configuration.
|
|
395
by Janos Gyerik
added example configuration for logging to file |
150 |
#
|
151 |
# Example usage:
|
|
152 |
# import logging
|
|
153 |
# logger = logging.getLogger(__name__)
|
|
154 |
# logger.debug('something happened')
|
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
155 |
LOGGING = { |
156 |
'version': 1, |
|
157 |
'disable_existing_loggers': False, |
|
395
by Janos Gyerik
added example configuration for logging to file |
158 |
'formatters': { |
159 |
'verbose': { |
|
160 |
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s', |
|
161 |
},
|
|
162 |
'simple': { |
|
163 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s', |
|
164 |
},
|
|
165 |
},
|
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
166 |
'handlers': { |
167 |
'mail_admins': { |
|
168 |
'level': 'ERROR', |
|
169 |
'class': 'django.utils.log.AdminEmailHandler' |
|
395
by Janos Gyerik
added example configuration for logging to file |
170 |
},
|
171 |
'file': { |
|
172 |
'level': 'DEBUG', |
|
173 |
'class': 'logging.FileHandler', |
|
174 |
'filename': 'debug.log', |
|
175 |
'formatter': 'simple', |
|
176 |
},
|
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
177 |
},
|
178 |
'loggers': { |
|
179 |
'django.request': { |
|
180 |
'handlers': ['mail_admins'], |
|
181 |
'level': 'ERROR', |
|
182 |
'propagate': True, |
|
183 |
},
|
|
395
by Janos Gyerik
added example configuration for logging to file |
184 |
'oneliners': { |
185 |
'handlers': ['file'], |
|
186 |
'level': 'DEBUG', |
|
187 |
},
|
|
393
by Janos Gyerik
cleaned up the handling of static files, and some bugfixes in maintenance_urls |
188 |
}
|
189 |
}
|
|
190 |
||
191 |
||
192 |
### project specific django settings
|
|
193 |
||
194 |
AUTH_PROFILE_MODULE = 'api.UserProfile' |
|
172
by Janos Gyerik
added settings.USE_DJANGO_STATIC_SERVE_FOR_MEDIA to use instead of DEBUG to determine whether to have Django serve static files or not, typically in a development environment |
195 |
|
2
by Janos Gyerik
added most base files, nothing visible yet |
196 |
|
308
by Janos Gyerik
implemented email notification on comments |
197 |
### project specific custom settings
|
2
by Janos Gyerik
added most base files, nothing visible yet |
198 |
|
113
by Janos Gyerik
new one-liners are now tweeted to @bashoneliners |
199 |
TWITTER = { |
378
by Janos Gyerik
minor bugfix, and updated settings sample |
200 |
'consumer_key': '', |
201 |
'consumer_secret': '', |
|
202 |
'access_token': '', |
|
203 |
'access_token_secret': '', |
|
113
by Janos Gyerik
new one-liners are now tweeted to @bashoneliners |
204 |
}
|
2
by Janos Gyerik
added most base files, nothing visible yet |
205 |
|
308
by Janos Gyerik
implemented email notification on comments |
206 |
### emails
|
207 |
#
|
|
208 |
#EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
|
209 |
#EMAIL_FILE_PATH = '/tmp/django-emails'
|
|
361
by Janos Gyerik
added CustomFileEmailBackend because the alternative debugging backends by django are slow on a home pc without a mail server because of the message.message() call |
210 |
#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
211 |
EMAIL_FILE_PATH = '/tmp/django-emails.log' |
|
390
by Janos Gyerik
one more tiny fix in the sample settings... |
212 |
EMAIL_BACKEND = 'oneliners.email.CustomFileEmailBackend' |
308
by Janos Gyerik
implemented email notification on comments |
213 |
|
346
by Janos Gyerik
implemented url shortening in tweets |
214 |
### url shortening
|
215 |
#
|
|
216 |
GOO_GL_API_URL = 'https://www.googleapis.com/urlshortener/v1/url' |
|
217 |
GOO_GL_API_KEY = '' |
|
218 |
||
2
by Janos Gyerik
added most base files, nothing visible yet |
219 |
|
220 |
# eof
|