Skip to content

Commit 0517aa6

Browse files
committed
improved documentation, fixed a few minor things. ready for merging search with master !
1 parent 3a07e5f commit 0517aa6

File tree

9 files changed

+110
-24
lines changed

9 files changed

+110
-24
lines changed

djity/project_skeleton/local_settings.py_tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ DEBUG = {develop!r}
3232
TEMPLATE_DEBUG = DEBUG
3333
DEBUG_TOOLBAR = DEBUG
3434

35+
DEBUG_TOOLBAR_CONFIG = {{}}
36+
DEBUG_TOOLBAR_CONFIG["INTERCEPT_REDIRECTS"] = False
37+
3538
if DEBUG :
3639
LOG_LEVEL = 'DEBUG'
3740
else:

docsrc/source/admin/commands.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Project management commands
2+
===========================
3+
4+
* Prepare the databases. Useful in particular if you wish to update Djity for an existing project, or are modifying the models of an application used by the current project. (This is used automatically if you select the development mode of `djity-admin.py create_project`)::
5+
6+
$ python manage.py syncdb
7+
8+
* Create initial data for an empty project. (This is used automatically if you select the development mode of `djity-admin.py create_project`)::
9+
10+
$ python manage.py create_portal
11+
12+
* Run development server. (This is used automatically if you select the development mode of `djity-admin.py create_project`)::
13+
14+
$ python manage.py runserver
15+
16+
* Update search indexes. When the data of indexable contents from a project is modified, you should update all search indexes::
17+
18+
$ python manage.py update_indexes --using=all
19+
20+
* Install an application in the current project. You can use `djity-admin.py ls_apps` to list all installed apps in the system::
21+
22+
$ python manage.py install_app <app>

docsrc/source/admin/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Administration guide
2+
====================
3+
4+
Administrate a Djity based website. Still very raw.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
commands.rst
10+

docsrc/source/developer/environment.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Development environment
44
Virtualenv
55
++++++++++
66

7-
A virtual environment is mostly useful for a developer's working environment and more generally to put djity in a box separated from the rest of your system. You are free to skip this part if it is not relevant to your needs.
7+
A virtual environment is mostly useful for a developer's working environment and more generally to put Djity in a box separated from the rest of your system. You are free to skip this part if it is not relevant to your needs.
88
See `<http://virtualenv.openplans.org/>`_, and `<http://www.doughellmann.com/projects/virtualenvwrapper/>`_ to learn more about the tools we recommend.
99
You will need to have virtualenvwrapper installed, you can find installation instructions here: `<http://www.doughellmann.com/docs/virtualenvwrapper/install.html#basic-installation>`_.
1010

@@ -33,7 +33,7 @@ Afterwards, each time you want to work with djity you should type something like
3333

3434
$ workon djity
3535

36-
You can exit this environement with the deactivate command::
36+
You can exit this environment with the deactivate command::
3737

3838
$ deactivate
3939

@@ -85,10 +85,16 @@ You have to install :
8585

8686
$ sudo apt-get install python-imaging
8787
88+
* `Haystack <http://haystacksearch.org/>`_ (through our fork on github because of added features)::
89+
90+
$ git clone https://github.com/albanm/django-haystack haystack
91+
$ cd haystack
92+
$ python setup.py install
93+
8894
Optional dependences
8995
--------------------
9096

91-
* `Django Debug Toolbar <http://robhudson.github.com/django-debug-toolbar/>`_ (useful for developpers and required by option 'develop' of 'djity-admin.py create_project')::
97+
* `Django Debug Toolbar <http://robhudson.github.com/django-debug-toolbar/>`_ (useful for developers and required by option 'develop' of 'djity-admin.py create_project')::
9298

9399
$ pip install django-debug-toolbar
94100

@@ -108,15 +114,15 @@ without repeating the installation::
108114

109115
$ python setup.py develop
110116

111-
Non-contributors Web admins or application developpers should probably use the 'install' command::
117+
Non-contributors Web admins or application developers should probably use the 'install' command::
112118

113119
$ python setup.py install
114120

115121

116122
Setup of a new project
117123
++++++++++++++++++++++
118124

119-
Now that djity and all its required packages are installed you can create a new development project::
125+
Now that Djity and all its required packages are installed you can create a new development project::
120126

121127
$ djity-admin.py create_project /path/to/my/project
122128

docsrc/source/developer/index.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
Developers Guide
1+
Developers guide
22
================
33

44

5-
This guide is write for programers wishing improve Djity itself.
5+
This guide is written for programmers wishing to improve Djity itself or develop applications for Djity.
66

77

88
.. toctree::
99
:maxdepth: 2
1010

1111
environment.rst
12-
documention.rst
12+
documentation.rst
1313
localization.rst
14-
communication.rst
15-
role.rst
16-
conventions.rst
14+
1715

docsrc/source/developer/localization.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Language Localisation
1+
Language localization
22
=====================
33

4-
Instructions below are for localisation/internationalization of Djity. However
4+
Instructions below are for localization/internationalization of Djity. However
55
Djity applications being organized in a very similar way, applications
6-
developpers could be interested as well.
6+
developers could be interested as well.
77

88
Interface localisation
99
++++++++++++++++++++++
1010

11-
Djity uses Django in a pretty standard way for internalization/localisation `<http://docs.djangoproject.com/en/dev/topics/i18n/>`_.
11+
Djity uses Django in a pretty standard way for internalization/localization `<http://docs.djangoproject.com/en/dev/topics/i18n/>`_.
1212

13-
Messages are generated in the locale directory of djity's package. Commands
13+
Messages are generated in the locale directory of Djity's package. Commands
1414
below should be used in the directory of Djity's main package (directory 'djity' in root).
1515

1616
A new language translation (chinese in the example below) for python file and template can be added by ::
@@ -32,7 +32,7 @@ afterwards. ::
3232
django-admin.py compilemessages
3333

3434

35-
User content localisation
35+
User content localization
3636
+++++++++++++++++++++++++
3737

3838
Djity allows its users to define multi-language contents without any particular

docsrc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Incoming features
5252

5353
tutorial/index.rst
5454
developer/index.rst
55+
admin/index.rst
5556
api/modules.rst
5657

5758

docsrc/source/settings.py

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,28 @@
3737
TIME_FORMAT = None
3838
# Absolute path to the directory that holds media. Example: "/home/media/media.lawrence.com/"
3939
MEDIA_ROOT = "%s/media" % PROJECT_ROOT
40+
STATIC_ROOT = "%s/static" % PROJECT_ROOT
4041

4142
# Absolute path to the directory containing data for this intance of djity
4243
DATA_DIR = "%s/data" % PROJECT_ROOT
4344

4445
# Djity's themeroller textures and icons directories
45-
TEXTURES_DIR = "%s/images/textures/" % MEDIA_ROOT
46-
ICONS_DIR = "%s/images/icons/" % MEDIA_ROOT
46+
TEXTURES_DIR = "%s/djity/images/textures/" % STATIC_ROOT
47+
ICONS_DIR = "%s/djity/images/icons/" % STATIC_ROOT
4748

4849
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
4950
# trailing slash if there is a path component (optional in other cases).
5051
# Examples: "http://media.lawrence.com", "http://example.com/media/"
5152
MEDIA_URL = '/site_media/'
53+
STATIC_URL = '/site_static/'
5254

5355
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a trailing slash. Examples: "http://foo.com/media/", "/media/".
5456
ADMIN_MEDIA_PREFIX = '/media/'
5557

5658
DAJAXICE_MEDIA_PREFIX="dajaxice" # Will create http://yourdomain.com/dajaxice/...
5759

5860
# Make this unique, and don't share it with anybody.
59-
SECRET_KEY = '+uf*31w)3i8w74)1(^6u%utlfyb^lzu_1_4rqt=+c55v*=lj3g'
61+
SECRET_KEY = 't%u=6xy3=1bhbf$2us1ekf4l8o(jiq_-!m&j=&ckd0u03dfh(1'
6062

6163
# List of callables that know how to import templates from various sources.
6264
TEMPLATE_LOADERS = (
@@ -69,6 +71,7 @@
6971
'localeurl.middleware.LocaleURLMiddleware',
7072
'django.middleware.common.CommonMiddleware',
7173
'django.middleware.csrf.CsrfViewMiddleware',
74+
'django.middleware.csrf.CsrfResponseMiddleware',
7275
'django.contrib.sessions.middleware.SessionMiddleware',
7376
'django.contrib.messages.middleware.MessageMiddleware',
7477
'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -85,6 +88,7 @@
8588
'django.core.context_processors.media',
8689
'django.core.context_processors.request',
8790
'django.contrib.messages.context_processors.messages',
91+
'django.core.context_processors.static',
8892
)
8993

9094
INSTALLED_APPS = [
@@ -97,25 +101,28 @@
97101
'django.contrib.sessions',
98102
'django.contrib.sites',
99103
'django.contrib.markup',
100-
'django.contrib.admin',
101104
'django.contrib.messages',
102105
'django.contrib.comments',
106+
'django.contrib.staticfiles',
103107

104108
#extensions
105-
'django_extensions',
106-
'tagging',
107109

108110
# Dajax
109111
'dajaxice',
110112
'dajax',
111113

114+
# Haystack for search
115+
'haystack',
116+
112117
#Djity Core
118+
'djity',
113119
'djity.portlet',
114120
'djity.style',
115121
'djity.portal',
116122
'djity.project',
117123
'djity.simplepage',
118124
'djity.transmeta',
125+
'djity.search',
119126
]
120127

121128
###########################################
@@ -155,6 +162,15 @@
155162
# list of permissions to check when updating djity's context
156163
PERMISSIONS = ['view','edit','upload','manage']
157164

165+
# List of visible statuses according to role (used to filter search results)
166+
HIDDEN_STATUSES = {
167+
ANONYMOUS:[DRAFT,PRIVATE],
168+
AWAITING:[DRAFT,PRIVATE],
169+
USER:[DRAFT],
170+
CONTRIBUTOR:[],
171+
MANAGER:[],
172+
}
173+
158174
# Status display in user interface
159175
STATUS_DISPLAY = [[DRAFT,'Draft'],[PRIVATE,'Private'],[PUBLIC,'Public']]
160176

@@ -185,6 +201,7 @@
185201
LANGUAGES = (
186202
('en', ugettext(u'English')),
187203
('fr', ugettext(u'Français')),
204+
('zh', ugettext(u'中文')),
188205
)
189206

190207
USE_L10N = True
@@ -198,6 +215,34 @@
198215

199216
FIXTURE_DIRS = 'data/fixtures'
200217

218+
###########################
219+
# Djity indexing settings #
220+
###########################
221+
222+
# Haystack search engine connections configuration
223+
HAYSTACK_CONNECTIONS = {'default':{
224+
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
225+
'PATH': '%s/data/whoosh/djity_index/default' % (PROJECT_ROOT),
226+
'STORAGE': 'file',
227+
'POST_LIMIT': 128 * 1024 * 1024,
228+
'INCLUDE_SPELLING': True,
229+
'BATCH_SIZE': 100,
230+
}
231+
}
232+
233+
for (language,language_repr) in LANGUAGES:
234+
HAYSTACK_CONNECTIONS['default_'+language] = {
235+
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
236+
'PATH': '%s/data/whoosh/djity_index/%s' % (PROJECT_ROOT,language),
237+
'STORAGE': 'file',
238+
'POST_LIMIT': 128 * 1024 * 1024,
239+
'INCLUDE_SPELLING': True,
240+
'BATCH_SIZE': 100,
241+
'LANGUAGE': '%s' % language
242+
}
243+
244+
HAYSTACK_ROUTERS = ['haystack.routers.LanguageRouter']
245+
201246
###################################################################
202247
# Import local settings and those from djity apps #
203248
###################################################################
@@ -206,5 +251,6 @@
206251
# in local_settings.py
207252

208253
DJITY_APPS = []
209-
210254
DEFAULT_STYLE = []
255+
256+

0 commit comments

Comments
 (0)