Show More
@@ -1,198 +1,199 b'' | |||||
1 | # Django settings for neboard project. |
|
1 | # Django settings for neboard project. | |
2 | import os |
|
2 | import os | |
3 | import markdown |
|
3 | import markdown | |
4 | from boards.mdx_neboard import markdown_extended |
|
4 | from boards.mdx_neboard import markdown_extended | |
5 |
|
5 | |||
6 | DEBUG = True |
|
6 | DEBUG = True | |
7 | TEMPLATE_DEBUG = DEBUG |
|
7 | TEMPLATE_DEBUG = DEBUG | |
8 |
|
8 | |||
9 | ADMINS = ( |
|
9 | ADMINS = ( | |
10 | # ('Your Name', 'your_email@example.com'), |
|
10 | # ('Your Name', 'your_email@example.com'), | |
11 | ('admin', 'admin@example.com') |
|
11 | ('admin', 'admin@example.com') | |
12 | ) |
|
12 | ) | |
13 |
|
13 | |||
14 | MANAGERS = ADMINS |
|
14 | MANAGERS = ADMINS | |
15 |
|
15 | |||
16 | DATABASES = { |
|
16 | DATABASES = { | |
17 | 'default': { |
|
17 | 'default': { | |
18 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
|
18 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | |
19 | 'NAME': 'database.db', # Or path to database file if using sqlite3. |
|
19 | 'NAME': 'database.db', # Or path to database file if using sqlite3. | |
20 | 'USER': '', # Not used with sqlite3. |
|
20 | 'USER': '', # Not used with sqlite3. | |
21 | 'PASSWORD': '', # Not used with sqlite3. |
|
21 | 'PASSWORD': '', # Not used with sqlite3. | |
22 | 'HOST': '', # Set to empty string for localhost. 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. |
|
23 | 'PORT': '', # Set to empty string for default. Not used with sqlite3. | |
24 | } |
|
24 | } | |
25 | } |
|
25 | } | |
26 |
|
26 | |||
27 | # Local time zone for this installation. Choices can be found here: |
|
27 | # Local time zone for this installation. Choices can be found here: | |
28 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
28 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name | |
29 | # although not all choices may be available on all operating systems. |
|
29 | # although not all choices may be available on all operating systems. | |
30 | # In a Windows environment this must be set to your system time zone. |
|
30 | # In a Windows environment this must be set to your system time zone. | |
31 | TIME_ZONE = 'Europe/Kiev' |
|
31 | TIME_ZONE = 'Europe/Kiev' | |
32 |
|
32 | |||
33 | # Language code for this installation. All choices can be found here: |
|
33 | # Language code for this installation. All choices can be found here: | |
34 | # http://www.i18nguy.com/unicode/language-identifiers.html |
|
34 | # http://www.i18nguy.com/unicode/language-identifiers.html | |
35 |
LANGUAGE_CODE = ' |
|
35 | LANGUAGE_CODE = 'en' | |
36 |
|
36 | |||
37 | SITE_ID = 1 |
|
37 | SITE_ID = 1 | |
38 |
|
38 | |||
39 | # If you set this to False, Django will make some optimizations so as not |
|
39 | # If you set this to False, Django will make some optimizations so as not | |
40 | # to load the internationalization machinery. |
|
40 | # to load the internationalization machinery. | |
41 | USE_I18N = True |
|
41 | USE_I18N = True | |
42 |
|
42 | |||
43 | # If you set this to False, Django will not format dates, numbers and |
|
43 | # If you set this to False, Django will not format dates, numbers and | |
44 | # calendars according to the current locale. |
|
44 | # calendars according to the current locale. | |
45 | USE_L10N = True |
|
45 | USE_L10N = True | |
46 |
|
46 | |||
47 | # If you set this to False, Django will not use timezone-aware datetimes. |
|
47 | # If you set this to False, Django will not use timezone-aware datetimes. | |
48 | USE_TZ = True |
|
48 | USE_TZ = True | |
49 |
|
49 | |||
50 | # Absolute filesystem path to the directory that will hold user-uploaded files. |
|
50 | # Absolute filesystem path to the directory that will hold user-uploaded files. | |
51 | # Example: "/home/media/media.lawrence.com/media/" |
|
51 | # Example: "/home/media/media.lawrence.com/media/" | |
52 | MEDIA_ROOT = './media/' |
|
52 | MEDIA_ROOT = './media/' | |
53 |
|
53 | |||
54 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
54 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a | |
55 | # trailing slash. |
|
55 | # trailing slash. | |
56 | # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
|
56 | # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" | |
57 | MEDIA_URL = '/media/' |
|
57 | MEDIA_URL = '/media/' | |
58 |
|
58 | |||
59 | # Absolute path to the directory static files should be collected to. |
|
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 |
|
60 | # Don't put anything in this directory yourself; store your static files | |
61 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
61 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. | |
62 | # Example: "/home/media/media.lawrence.com/static/" |
|
62 | # Example: "/home/media/media.lawrence.com/static/" | |
63 | STATIC_ROOT = '' |
|
63 | STATIC_ROOT = '' | |
64 |
|
64 | |||
65 | # URL prefix for static files. |
|
65 | # URL prefix for static files. | |
66 | # Example: "http://media.lawrence.com/static/" |
|
66 | # Example: "http://media.lawrence.com/static/" | |
67 | STATIC_URL = '/static/' |
|
67 | STATIC_URL = '/static/' | |
68 |
|
68 | |||
69 | # Additional locations of static files |
|
69 | # Additional locations of static files | |
70 | # It is really a hack, put real paths, not related |
|
70 | # It is really a hack, put real paths, not related | |
71 | STATICFILES_DIRS = ( |
|
71 | STATICFILES_DIRS = ( | |
72 | os.path.dirname(__file__) + '/boards/static', |
|
72 | os.path.dirname(__file__) + '/boards/static', | |
73 |
|
73 | |||
74 | # '/d/work/python/django/neboard/neboard/boards/static', |
|
74 | # '/d/work/python/django/neboard/neboard/boards/static', | |
75 | # Put strings here, like "/home/html/static" or "C:/www/django/static". |
|
75 | # Put strings here, like "/home/html/static" or "C:/www/django/static". | |
76 | # Always use forward slashes, even on Windows. |
|
76 | # Always use forward slashes, even on Windows. | |
77 | # Don't forget to use absolute paths, not relative paths. |
|
77 | # Don't forget to use absolute paths, not relative paths. | |
78 | ) |
|
78 | ) | |
79 |
|
79 | |||
80 | # List of finder classes that know how to find static files in |
|
80 | # List of finder classes that know how to find static files in | |
81 | # various locations. |
|
81 | # various locations. | |
82 | STATICFILES_FINDERS = ( |
|
82 | STATICFILES_FINDERS = ( | |
83 | 'django.contrib.staticfiles.finders.FileSystemFinder', |
|
83 | 'django.contrib.staticfiles.finders.FileSystemFinder', | |
84 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
84 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', | |
85 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
|
85 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder', | |
86 | ) |
|
86 | ) | |
87 |
|
87 | |||
88 | # Make this unique, and don't share it with anybody. |
|
88 | # Make this unique, and don't share it with anybody. | |
89 | SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o' |
|
89 | SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o' | |
90 |
|
90 | |||
91 | # List of callables that know how to import templates from various sources. |
|
91 | # List of callables that know how to import templates from various sources. | |
92 | TEMPLATE_LOADERS = ( |
|
92 | TEMPLATE_LOADERS = ( | |
93 | 'django.template.loaders.filesystem.Loader', |
|
93 | 'django.template.loaders.filesystem.Loader', | |
94 | 'django.template.loaders.app_directories.Loader', |
|
94 | 'django.template.loaders.app_directories.Loader', | |
95 | # 'django.template.loaders.eggs.Loader', |
|
95 | # 'django.template.loaders.eggs.Loader', | |
96 | ) |
|
96 | ) | |
97 |
|
97 | |||
98 | TEMPLATE_CONTEXT_PROCESSORS = ( |
|
98 | TEMPLATE_CONTEXT_PROCESSORS = ( | |
99 | 'django.core.context_processors.media', |
|
99 | 'django.core.context_processors.media', | |
100 | 'django.core.context_processors.static', |
|
100 | 'django.core.context_processors.static', | |
101 | 'django.core.context_processors.request', |
|
101 | 'django.core.context_processors.request', | |
102 | 'django.contrib.auth.context_processors.auth', |
|
102 | 'django.contrib.auth.context_processors.auth', | |
103 | ) |
|
103 | ) | |
104 |
|
104 | |||
105 | MIDDLEWARE_CLASSES = ( |
|
105 | MIDDLEWARE_CLASSES = ( | |
|
106 | 'django.contrib.sessions.middleware.SessionMiddleware', | |||
|
107 | 'django.middleware.locale.LocaleMiddleware', | |||
106 | 'django.middleware.common.CommonMiddleware', |
|
108 | 'django.middleware.common.CommonMiddleware', | |
107 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
|||
108 | # 'django.middleware.csrf.CsrfViewMiddleware', |
|
109 | # 'django.middleware.csrf.CsrfViewMiddleware', | |
109 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
110 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
110 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
111 | 'django.contrib.messages.middleware.MessageMiddleware', | |
111 | # Uncomment the next line for simple clickjacking protection: |
|
112 | # Uncomment the next line for simple clickjacking protection: | |
112 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
113 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', | |
113 | ) |
|
114 | ) | |
114 |
|
115 | |||
115 | ROOT_URLCONF = 'neboard.urls' |
|
116 | ROOT_URLCONF = 'neboard.urls' | |
116 |
|
117 | |||
117 | # Python dotted path to the WSGI application used by Django's runserver. |
|
118 | # Python dotted path to the WSGI application used by Django's runserver. | |
118 | WSGI_APPLICATION = 'neboard.wsgi.application' |
|
119 | WSGI_APPLICATION = 'neboard.wsgi.application' | |
119 |
|
120 | |||
120 | TEMPLATE_DIRS = ( |
|
121 | TEMPLATE_DIRS = ( | |
121 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
122 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". | |
122 | # Always use forward slashes, even on Windows. |
|
123 | # Always use forward slashes, even on Windows. | |
123 | # Don't forget to use absolute paths, not relative paths. |
|
124 | # Don't forget to use absolute paths, not relative paths. | |
124 | 'templates', |
|
125 | 'templates', | |
125 | ) |
|
126 | ) | |
126 |
|
127 | |||
127 | INSTALLED_APPS = ( |
|
128 | INSTALLED_APPS = ( | |
128 | 'django.contrib.auth', |
|
129 | 'django.contrib.auth', | |
129 | 'django.contrib.contenttypes', |
|
130 | 'django.contrib.contenttypes', | |
130 | 'django.contrib.sessions', |
|
131 | 'django.contrib.sessions', | |
131 | # 'django.contrib.sites', |
|
132 | # 'django.contrib.sites', | |
132 | 'django.contrib.messages', |
|
133 | 'django.contrib.messages', | |
133 | 'django.contrib.staticfiles', |
|
134 | 'django.contrib.staticfiles', | |
134 | # Uncomment the next line to enable the admin: |
|
135 | # Uncomment the next line to enable the admin: | |
135 | 'django.contrib.admin', |
|
136 | 'django.contrib.admin', | |
136 | # Uncomment the next line to enable admin documentation: |
|
137 | # Uncomment the next line to enable admin documentation: | |
137 | # 'django.contrib.admindocs', |
|
138 | # 'django.contrib.admindocs', | |
138 | 'django.contrib.markup', |
|
139 | 'django.contrib.markup', | |
139 | 'django_cleanup', |
|
140 | 'django_cleanup', | |
140 | 'boards', |
|
141 | 'boards', | |
141 | 'captcha', |
|
142 | 'captcha', | |
142 | ) |
|
143 | ) | |
143 |
|
144 | |||
144 | # TODO: NEED DESIGN FIXES |
|
145 | # TODO: NEED DESIGN FIXES | |
145 | CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s ' |
|
146 | CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s ' | |
146 | u'<div class="form-label">%(image)s</div>' |
|
147 | u'<div class="form-label">%(image)s</div>' | |
147 | u'<div class="form-text">%(text_field)s</div>') |
|
148 | u'<div class="form-text">%(text_field)s</div>') | |
148 |
|
149 | |||
149 | # A sample logging configuration. The only tangible logging |
|
150 | # A sample logging configuration. The only tangible logging | |
150 | # performed by this configuration is to send an email to |
|
151 | # performed by this configuration is to send an email to | |
151 | # the site admins on every HTTP 500 error when DEBUG=False. |
|
152 | # the site admins on every HTTP 500 error when DEBUG=False. | |
152 | # See http://docs.djangoproject.com/en/dev/topics/logging for |
|
153 | # See http://docs.djangoproject.com/en/dev/topics/logging for | |
153 | # more details on how to customize your logging configuration. |
|
154 | # more details on how to customize your logging configuration. | |
154 | LOGGING = { |
|
155 | LOGGING = { | |
155 | 'version': 1, |
|
156 | 'version': 1, | |
156 | 'disable_existing_loggers': False, |
|
157 | 'disable_existing_loggers': False, | |
157 | 'filters': { |
|
158 | 'filters': { | |
158 | 'require_debug_false': { |
|
159 | 'require_debug_false': { | |
159 | '()': 'django.utils.log.RequireDebugFalse' |
|
160 | '()': 'django.utils.log.RequireDebugFalse' | |
160 | } |
|
161 | } | |
161 | }, |
|
162 | }, | |
162 | 'handlers': { |
|
163 | 'handlers': { | |
163 | 'mail_admins': { |
|
164 | 'mail_admins': { | |
164 | 'level': 'ERROR', |
|
165 | 'level': 'ERROR', | |
165 | 'filters': ['require_debug_false'], |
|
166 | 'filters': ['require_debug_false'], | |
166 | 'class': 'django.utils.log.AdminEmailHandler' |
|
167 | 'class': 'django.utils.log.AdminEmailHandler' | |
167 | } |
|
168 | } | |
168 | }, |
|
169 | }, | |
169 | 'loggers': { |
|
170 | 'loggers': { | |
170 | 'django.request': { |
|
171 | 'django.request': { | |
171 | 'handlers': ['mail_admins'], |
|
172 | 'handlers': ['mail_admins'], | |
172 | 'level': 'ERROR', |
|
173 | 'level': 'ERROR', | |
173 | 'propagate': True, |
|
174 | 'propagate': True, | |
174 | }, |
|
175 | }, | |
175 | } |
|
176 | } | |
176 | } |
|
177 | } | |
177 |
|
178 | |||
178 | MARKUP_FIELD_TYPES = ( |
|
179 | MARKUP_FIELD_TYPES = ( | |
179 | ('markdown', markdown_extended), |
|
180 | ('markdown', markdown_extended), | |
180 | ) |
|
181 | ) | |
181 | # Custom imageboard settings |
|
182 | # Custom imageboard settings | |
182 | MAX_POSTS_PER_THREAD = 10 # Thread bumplimit |
|
183 | MAX_POSTS_PER_THREAD = 10 # Thread bumplimit | |
183 | MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count |
|
184 | MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count | |
184 | THREADS_PER_PAGE = 10 |
|
185 | THREADS_PER_PAGE = 10 | |
185 | SITE_NAME = 'Neboard' |
|
186 | SITE_NAME = 'Neboard' | |
186 |
|
187 | |||
187 | THEMES = [ |
|
188 | THEMES = [ | |
188 | ('md', 'Mystic Dark'), |
|
189 | ('md', 'Mystic Dark'), | |
189 | ('sw', 'Snow White') ] |
|
190 | ('sw', 'Snow White') ] | |
190 |
|
191 | |||
191 | DEFAULT_THEME = 'md' |
|
192 | DEFAULT_THEME = 'md' | |
192 |
|
193 | |||
193 | POPULAR_TAGS = 10 |
|
194 | POPULAR_TAGS = 10 | |
194 | LAST_REPLIES_COUNT = 3 |
|
195 | LAST_REPLIES_COUNT = 3 | |
195 |
|
196 | |||
196 | ENABLE_CAPTCHA = True |
|
197 | ENABLE_CAPTCHA = True | |
197 | # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown |
|
198 | # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown | |
198 | CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds No newline at end of file |
|
199 | CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds |
General Comments 0
You need to be logged in to leave comments.
Login now