##// END OF EJS Templates
Updated default settings and documents
neko259 -
r1523:d5f205d0 decentral
parent child Browse files
Show More
@@ -1,241 +1,232 b''
1 # Django settings for neboard project.
1 # Django settings for neboard project.
2 import os
2 import os
3
3
4 DEBUG = True
4 DEBUG = True
5 TEMPLATE_DEBUG = DEBUG
6
5
7 ADMINS = (
6 ADMINS = (
8 # ('Your Name', 'your_email@example.com'),
7 # ('Your Name', 'your_email@example.com'),
9 ('admin', 'admin@example.com')
8 ('admin', 'admin@example.com')
10 )
9 )
11
10
12 MANAGERS = ADMINS
11 MANAGERS = ADMINS
13
12
14 DATABASES = {
13 DATABASES = {
15 'default': {
14 'default': {
16 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
15 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
17 'NAME': 'database.db', # Or path to database file if using sqlite3.
16 'NAME': 'database.db', # Or path to database file if using sqlite3.
18 'USER': '', # Not used with sqlite3.
17 'USER': '', # Not used with sqlite3.
19 'PASSWORD': '', # Not used with sqlite3.
18 'PASSWORD': '', # Not used with sqlite3.
20 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
19 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
21 'PORT': '', # Set to empty string for default. Not used with sqlite3.
20 'PORT': '', # Set to empty string for default. Not used with sqlite3.
22 'CONN_MAX_AGE': None,
21 'CONN_MAX_AGE': None,
23 }
22 }
24 }
23 }
25
24
26 # Local time zone for this installation. Choices can be found here:
25 # Local time zone for this installation. Choices can be found here:
27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
26 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
28 # although not all choices may be available on all operating systems.
27 # although not all choices may be available on all operating systems.
29 # In a Windows environment this must be set to your system time zone.
28 # In a Windows environment this must be set to your system time zone.
30 TIME_ZONE = 'Europe/Kiev'
29 TIME_ZONE = 'Europe/Kiev'
31
30
32 # Language code for this installation. All choices can be found here:
31 # Language code for this installation. All choices can be found here:
33 # http://www.i18nguy.com/unicode/language-identifiers.html
32 # http://www.i18nguy.com/unicode/language-identifiers.html
34 LANGUAGE_CODE = 'en'
33 LANGUAGE_CODE = 'en'
35
34
36 SITE_ID = 1
35 SITE_ID = 1
37
36
38 # If you set this to False, Django will make some optimizations so as not
37 # If you set this to False, Django will make some optimizations so as not
39 # to load the internationalization machinery.
38 # to load the internationalization machinery.
40 USE_I18N = True
39 USE_I18N = True
41
40
42 # If you set this to False, Django will not format dates, numbers and
41 # If you set this to False, Django will not format dates, numbers and
43 # calendars according to the current locale.
42 # calendars according to the current locale.
44 USE_L10N = True
43 USE_L10N = True
45
44
46 # If you set this to False, Django will not use timezone-aware datetimes.
45 # If you set this to False, Django will not use timezone-aware datetimes.
47 USE_TZ = True
46 USE_TZ = True
48
47
49 USE_ETAGS = True
48 USE_ETAGS = True
50
49
51 # 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.
52 # Example: "/home/media/media.lawrence.com/media/"
51 # Example: "/home/media/media.lawrence.com/media/"
53 MEDIA_ROOT = './media/'
52 MEDIA_ROOT = './media/'
54
53
55 # 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
56 # trailing slash.
55 # trailing slash.
57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
56 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
58 MEDIA_URL = '/media/'
57 MEDIA_URL = '/media/'
59
58
60 # Absolute path to the directory static files should be collected to.
59 # Absolute path to the directory static files should be collected to.
61 # 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
62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
61 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
63 # Example: "/home/media/media.lawrence.com/static/"
62 # Example: "/home/media/media.lawrence.com/static/"
64 STATIC_ROOT = ''
63 STATIC_ROOT = ''
65
64
66 # URL prefix for static files.
65 # URL prefix for static files.
67 # Example: "http://media.lawrence.com/static/"
66 # Example: "http://media.lawrence.com/static/"
68 STATIC_URL = '/static/'
67 STATIC_URL = '/static/'
69
68
70 # Additional locations of static files
69 STATICFILES_DIRS = []
71 # It is really a hack, put real paths, not related
72 STATICFILES_DIRS = (
73 os.path.dirname(__file__) + '/boards/static',
74
75 # '/d/work/python/django/neboard/neboard/boards/static',
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 )
80
70
81 # List of finder classes that know how to find static files in
71 # List of finder classes that know how to find static files in
82 # various locations.
72 # various locations.
83 STATICFILES_FINDERS = (
73 STATICFILES_FINDERS = (
84 'django.contrib.staticfiles.finders.FileSystemFinder',
74 'django.contrib.staticfiles.finders.FileSystemFinder',
85 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
75 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
86 )
76 )
87
77
88 if DEBUG:
78 if DEBUG:
89 STATICFILES_STORAGE = \
79 STATICFILES_STORAGE = \
90 'django.contrib.staticfiles.storage.StaticFilesStorage'
80 'django.contrib.staticfiles.storage.StaticFilesStorage'
91 else:
81 else:
92 STATICFILES_STORAGE = \
82 STATICFILES_STORAGE = \
93 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
83 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
94
84
95 # Make this unique, and don't share it with anybody.
85 # Make this unique, and don't share it with anybody.
96 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
86 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
97
87
98 TEMPLATES = [{
88 TEMPLATES = [{
99 'BACKEND': 'django.template.backends.django.DjangoTemplates',
89 'BACKEND': 'django.template.backends.django.DjangoTemplates',
100 'DIRS': ['templates'],
90 'DIRS': ['templates'],
101 'OPTIONS': {
91 'OPTIONS': {
102 'loaders': [
92 'loaders': [
103 ('django.template.loaders.cached.Loader', [
93 ('django.template.loaders.cached.Loader', [
104 'django.template.loaders.filesystem.Loader',
94 'django.template.loaders.filesystem.Loader',
105 'django.template.loaders.app_directories.Loader',
95 'django.template.loaders.app_directories.Loader',
106 ]),
96 ]),
107 ],
97 ],
108 'context_processors': [
98 'context_processors': [
109 'django.template.context_processors.csrf',
99 'django.template.context_processors.csrf',
110 'django.core.context_processors.media',
100 'django.core.context_processors.media',
111 'django.core.context_processors.static',
101 'django.core.context_processors.static',
112 'django.core.context_processors.request',
102 'django.core.context_processors.request',
113 'django.contrib.auth.context_processors.auth',
103 'django.contrib.auth.context_processors.auth',
114 'boards.context_processors.user_and_ui_processor',
104 'boards.context_processors.user_and_ui_processor',
115 ],
105 ],
116 },
106 },
117 }]
107 }]
118
108
119
109
120 MIDDLEWARE_CLASSES = [
110 MIDDLEWARE_CLASSES = [
121 'django.middleware.http.ConditionalGetMiddleware',
111 'django.middleware.http.ConditionalGetMiddleware',
122 'django.contrib.sessions.middleware.SessionMiddleware',
112 'django.contrib.sessions.middleware.SessionMiddleware',
123 'django.middleware.locale.LocaleMiddleware',
113 'django.middleware.locale.LocaleMiddleware',
124 'django.middleware.common.CommonMiddleware',
114 'django.middleware.common.CommonMiddleware',
125 'django.contrib.auth.middleware.AuthenticationMiddleware',
115 'django.contrib.auth.middleware.AuthenticationMiddleware',
126 'django.contrib.messages.middleware.MessageMiddleware',
116 'django.contrib.messages.middleware.MessageMiddleware',
127 'boards.middlewares.BanMiddleware',
117 'boards.middlewares.BanMiddleware',
128 'boards.middlewares.TimezoneMiddleware',
118 'boards.middlewares.TimezoneMiddleware',
129 ]
119 ]
130
120
131 ROOT_URLCONF = 'neboard.urls'
121 ROOT_URLCONF = 'neboard.urls'
132
122
133 # Python dotted path to the WSGI application used by Django's runserver.
123 # Python dotted path to the WSGI application used by Django's runserver.
134 WSGI_APPLICATION = 'neboard.wsgi.application'
124 WSGI_APPLICATION = 'neboard.wsgi.application'
135
125
136 INSTALLED_APPS = (
126 INSTALLED_APPS = (
137 'django.contrib.auth',
127 'django.contrib.auth',
138 'django.contrib.contenttypes',
128 'django.contrib.contenttypes',
139 'django.contrib.sessions',
129 'django.contrib.sessions',
140 # 'django.contrib.sites',
130 # 'django.contrib.sites',
141 'django.contrib.messages',
131 'django.contrib.messages',
142 'django.contrib.staticfiles',
132 'django.contrib.staticfiles',
143 # Uncomment the next line to enable the admin:
133 # Uncomment the next line to enable the admin:
144 'django.contrib.admin',
134 'django.contrib.admin',
145 # Uncomment the next line to enable admin documentation:
135 # Uncomment the next line to enable admin documentation:
146 # 'django.contrib.admindocs',
136 # 'django.contrib.admindocs',
147 #'django.contrib.humanize',
137 #'django.contrib.humanize',
148
138
149 'debug_toolbar',
139 'debug_toolbar',
150
140
151 # Search
141 # Search
152 'haystack',
142 'haystack',
153
143
154 'boards',
144 'boards',
155 )
145 )
156
146
157 # A sample logging configuration. The only tangible logging
147 # A sample logging configuration. The only tangible logging
158 # performed by this configuration is to send an email to
148 # performed by this configuration is to send an email to
159 # the site admins on every HTTP 500 error when DEBUG=False.
149 # the site admins on every HTTP 500 error when DEBUG=False.
160 # See http://docs.djangoproject.com/en/dev/topics/logging for
150 # See http://docs.djangoproject.com/en/dev/topics/logging for
161 # more details on how to customize your logging configuration.
151 # more details on how to customize your logging configuration.
162 LOGGING = {
152 LOGGING = {
163 'version': 1,
153 'version': 1,
164 'disable_existing_loggers': False,
154 'disable_existing_loggers': False,
165 'formatters': {
155 'formatters': {
166 'verbose': {
156 'verbose': {
167 'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
157 'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
168 },
158 },
169 'simple': {
159 'simple': {
170 'format': '%(levelname)s %(asctime)s [%(name)s] %(message)s'
160 'format': '%(levelname)s %(asctime)s [%(name)s] %(message)s'
171 },
161 },
172 },
162 },
173 'filters': {
163 'filters': {
174 'require_debug_false': {
164 'require_debug_false': {
175 '()': 'django.utils.log.RequireDebugFalse'
165 '()': 'django.utils.log.RequireDebugFalse'
176 }
166 }
177 },
167 },
178 'handlers': {
168 'handlers': {
179 'console': {
169 'console': {
180 'level': 'DEBUG',
170 'level': 'DEBUG',
181 'class': 'logging.StreamHandler',
171 'class': 'logging.StreamHandler',
182 'formatter': 'simple'
172 'formatter': 'simple'
183 },
173 },
184 },
174 },
185 'loggers': {
175 'loggers': {
186 'boards': {
176 'boards': {
187 'handlers': ['console'],
177 'handlers': ['console'],
188 'level': 'DEBUG',
178 'level': 'DEBUG',
189 }
179 }
190 },
180 },
191 }
181 }
192
182
193 HAYSTACK_CONNECTIONS = {
183 HAYSTACK_CONNECTIONS = {
194 'default': {
184 'default': {
195 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
185 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
196 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
186 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
197 },
187 },
198 }
188 }
199
189
200 THEMES = [
190 THEMES = [
201 ('md', 'Mystic Dark'),
191 ('md', 'Mystic Dark'),
202 ('md_centered', 'Mystic Dark (centered)'),
192 ('md_centered', 'Mystic Dark (centered)'),
203 ('sw', 'Snow White'),
193 ('sw', 'Snow White'),
204 ('pg', 'Photon Gray'),
194 ('pg', 'Photon Gray'),
205 ]
195 ]
206
196
207 IMAGE_VIEWERS = [
197 IMAGE_VIEWERS = [
208 ('simple', 'Simple'),
198 ('simple', 'Simple'),
209 ('popup', 'Popup'),
199 ('popup', 'Popup'),
210 ]
200 ]
211
201
212 ALLOWED_HOSTS = ['*']
202 ALLOWED_HOSTS = ['*']
213
203
214 POSTING_DELAY = 20 # seconds
204 POSTING_DELAY = 20 # seconds
215
205
216 # Websocket settins
206 # Websocket settins
217 CENTRIFUGE_HOST = 'localhost'
207 CENTRIFUGE_HOST = 'localhost'
218 CENTRIFUGE_PORT = '9090'
208 CENTRIFUGE_PORT = '9090'
219
209
220 CENTRIFUGE_ADDRESS = 'http://{}:{}'.format(CENTRIFUGE_HOST, CENTRIFUGE_PORT)
210 CENTRIFUGE_ADDRESS = 'http://{}:{}'.format(CENTRIFUGE_HOST, CENTRIFUGE_PORT)
221 CENTRIFUGE_PROJECT_ID = '<project id here>'
211 CENTRIFUGE_PROJECT_ID = '<project id here>'
222 CENTRIFUGE_PROJECT_SECRET = '<project secret here>'
212 CENTRIFUGE_PROJECT_SECRET = '<project secret here>'
223 CENTRIFUGE_TIMEOUT = 5
213 CENTRIFUGE_TIMEOUT = 5
224
214
225 # Debug middlewares
215 # Debug middlewares
226 MIDDLEWARE_CLASSES += [
216 MIDDLEWARE_CLASSES += [
227 'debug_toolbar.middleware.DebugToolbarMiddleware',
217 'debug_toolbar.middleware.DebugToolbarMiddleware',
228 ]
218 ]
229
219
220
230 def custom_show_toolbar(request):
221 def custom_show_toolbar(request):
231 return request.user.has_perm('admin.debug')
222 return request.user.has_perm('admin.debug')
232
223
233 DEBUG_TOOLBAR_CONFIG = {
224 DEBUG_TOOLBAR_CONFIG = {
234 'ENABLE_STACKTRACES': True,
225 'ENABLE_STACKTRACES': True,
235 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar',
226 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar',
236 }
227 }
237
228
238 # FIXME Uncommenting this fails somehow. Need to investigate this
229 # FIXME Uncommenting this fails somehow. Need to investigate this
239 #DEBUG_TOOLBAR_PANELS += (
230 #DEBUG_TOOLBAR_PANELS += (
240 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
231 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
241 #)
232 #)
@@ -1,37 +1,50 b''
1 # INTRO #
1 # INTRO #
2
2
3 This project aims to create centralized forum-like discussion platform with
3 This project aims to create centralized forum-like discussion platform with
4 anonymity in mind.
4 anonymity in mind.
5
5
6 Main repository: https://bitbucket.org/neko259/neboard/
6 Main repository: https://bitbucket.org/neko259/neboard/
7
7
8 Site: http://neboard.me/
8 Site: http://neboard.me/
9
9
10 # INSTALLATION #
10 # INSTALLATION #
11
11
12 1. Install all dependencies over pip or system-wide
12 1. Install all dependencies over pip or system-wide
13
14 You can use virtualenv to speed up the process.
15
16 Use pip3 install -r requirements.txt
17
18 Dependencies for the database and search engine need to be installed manually
19 when you choose which one to use.
20
13 2. Setup a database in `neboard/settings.py`
21 2. Setup a database in `neboard/settings.py`
14 3. Run `./manage.py migrate` to apply all south migrations
22 3. Setup SECRET_KEY to a secret value in `neboard/settings.py`
15 4. Apply config changes to `boards/config/config.ini`. You can see the default settings in `boards/config/default_config.ini`
23 4. Run `./manage.py migrate` to apply all migrations
24 5. Apply config changes to `boards/config/config.ini`. You can see the default settings in `boards/config/default_config.ini`
25 6. If you want to use decetral engine, run `./manage.py generate_keypair` to generate keys
16
26
17 # RUNNING #
27 # RUNNING #
18
28
19 You can run the server using django default embedded webserver by running
29 You can run the server using django default embedded webserver by running:
20
30
21 ./manage.py runserver <address>:<port>
31 ./manage.py runserver <address>:<port>
22
32
23 See django-admin command help for details
33 See django-admin command help for details.
24
34
25 Also consider using wsgi or fcgi interfaces on production servers.
35 Also consider using wsgi or fcgi interfaces on production servers.
26
36
37 When running for the first time, you need to setup at least one section tag.
38 Go to the admin page and manually create one tag with "required" property set.
39
27 # UPGRADE #
40 # UPGRADE #
28
41
29 1. Backup your project data.
42 1. Backup your project data.
30 2. Copy the project contents over the old project directory
43 2. Copy the project contents over the old project directory
31 3. Run migrations by `./manage.py migrate`
44 3. Run migrations by `./manage.py migrate`
32
45
33 You can also just clone the mercurial project and pull it to update
46 You can also just clone the mercurial project and pull it to update
34
47
35 # CONCLUSION #
48 # CONCLUSION #
36
49
37 Enjoy our software and thank you!
50 Enjoy our software and thank you!
@@ -1,12 +1,13 b''
1 python-magic
1 python-magic
2 httplib2
2 httplib2
3 simplejson
3 simplejson
4 pytube
4 pytube
5 requests
5 requests
6 adjacent
6 adjacent
7 django-haystack
7 django-haystack
8 pillow
8 pillow
9 django>=1.8
9 django>=1.8
10 bbcode
10 bbcode
11 django-debug-toolbar
11 django-debug-toolbar
12 pytz
12 pytz
13 ecdsa No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now