Merge lp:~pydjwiki-dev/pydjwiki/no-proj into lp:pydjwiki
- no-proj
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | M. Nesvold |
Approved revision: | 39 |
Merged at revision: | 28 |
Proposed branch: | lp:~pydjwiki-dev/pydjwiki/no-proj |
Merge into: | lp:pydjwiki |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~pydjwiki-dev/pydjwiki/no-proj |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Louis Wilson | Needs Fixing | ||
Review via email: mp+6432@code.launchpad.net |
Commit message
Description of the change
M. Nesvold (mdnesvold) wrote : | # |
- 33. By M. Nesvold
-
Fixed fatal typo in installation instructions
- 34. By Louis Wilson <email address hidden>
-
Updated the documentation build system to use Make
- 35. By Louis Wilson <email address hidden>
-
Changed two docstrings to refer to non-deprecated functions
- 36. By Louis Wilson <email address hidden>
-
Updated installation documentation
Louis Wilson (louis-wins) wrote : | # |
Installation instructions seem to be lacking. I fixed what I could, but could not figure out how to get it to use the CSS file. For some reason PYDJWIKI_MEDIA_ROOT is not being defined, and I'm not really sure how that Middleware is supposed to work.
Also, as far as I can tell, the user has to add "${SITE_
I'll add this as a bug.
- 37. By M. Nesvold
-
Fixed autoloading of default data fixture on first syncdb
- 38. By M. Nesvold
-
Updated installation instructions to include installing humanize
- 39. By M. Nesvold
-
Added patch for bug #377492
Preview Diff
1 | === renamed file 'wiki/pydjwiki/__init__.py' => '__init__.py' | |||
2 | === renamed file 'wiki/pydjwiki/admin.py' => 'admin.py' | |||
3 | === renamed file 'wiki/pydjwiki/deprecation.py' => 'deprecation.py' | |||
4 | === renamed file 'wiki/pydjwiki/djhooks.py' => 'djhooks.py' | |||
5 | === renamed directory 'wiki/pydjwiki/doc' => 'doc' | |||
6 | === added file 'doc/Installation.tex' | |||
7 | --- doc/Installation.tex 1970-01-01 00:00:00 +0000 | |||
8 | +++ doc/Installation.tex 2009-05-11 17:55:38 +0000 | |||
9 | @@ -0,0 +1,65 @@ | |||
10 | 1 | \documentclass{article} | ||
11 | 2 | |||
12 | 3 | \usepackage{fullpage} | ||
13 | 4 | |||
14 | 5 | \begin{document} | ||
15 | 6 | \title{PyDjWiki Installation Guide} | ||
16 | 7 | \author{} | ||
17 | 8 | \date{} | ||
18 | 9 | \maketitle | ||
19 | 10 | |||
20 | 11 | \begin{abstract} | ||
21 | 12 | This document describes the steps necessary to get the PyDjWiki app running on a Django project. | ||
22 | 13 | \end{abstract} | ||
23 | 14 | |||
24 | 15 | \section{Start your project} | ||
25 | 16 | |||
26 | 17 | If you haven't done so already, start a project using \texttt{django-admin.py startproject}. | ||
27 | 18 | |||
28 | 19 | \section{Download PyDjWiki} | ||
29 | 20 | |||
30 | 21 | If you're reading this document, you've probably already done that. You can put the download wherever you want; you can either put it directly in your \texttt{site-packages} directory (as long as you name the folder \texttt{pydjwiki}), or somewhere else and put a symbolic link in \texttt{site-packages}: | ||
31 | 22 | |||
32 | 23 | \begin{verbatim} | ||
33 | 24 | ln -s path/to/download path/to/site-packages/pydjwiki | ||
34 | 25 | \end{verbatim} | ||
35 | 26 | |||
36 | 27 | \subsection{Finding \texttt{site-packages}} | ||
37 | 28 | |||
38 | 29 | You can find out where your \texttt{site-packages} directory is located by typing the following into a shell prompt: | ||
39 | 30 | |||
40 | 31 | \begin{verbatim} | ||
41 | 32 | python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" | ||
42 | 33 | \end{verbatim} | ||
43 | 34 | |||
44 | 35 | \section{Install the app} | ||
45 | 36 | |||
46 | 37 | Now you have to tell your site project to use the PyDjWiki app. | ||
47 | 38 | |||
48 | 39 | \subsection{Modify \texttt{settings.py}} | ||
49 | 40 | |||
50 | 41 | In your project's \texttt{settings.py}, make the following changes: | ||
51 | 42 | |||
52 | 43 | \begin{enumerate} | ||
53 | 44 | \item Add the string \texttt{"pydjwiki.djhooks.PyDjWikiMiddleware"} to the beginning of your \texttt{MIDDLEWARE\_{}CLASSES} setting. | ||
54 | 45 | \item Add the string \texttt{"pydjwiki.djhooks.context\_{}processor\_{}pydjwiki"} to your \texttt{TEMPLATE\_{}CONTEXT\_{}PROCESSORS} settings. | ||
55 | 46 | \item Anywhere in the file, preferably near the top, add the line \texttt{from pydjwiki.settings import *} to import default PyDjWiki settings. (This will also set \texttt{LOGIN\_{}URL} and \texttt{LOGIN\_{}REDIRECT\_{}URL} if they aren't defined elsewhere in your settings file.) | ||
56 | 47 | \end{enumerate} | ||
57 | 48 | |||
58 | 49 | \subsection{Modify your URLConf} | ||
59 | 50 | |||
60 | 51 | Add the following to your \texttt{urls.py} file: | ||
61 | 52 | |||
62 | 53 | \begin{verbatim} | ||
63 | 54 | urlpatterns += patterns("", | ||
64 | 55 | (r"^%s" % settings.PYDJWIKI_URL_ROOT[1:], include("pydjwiki.urls")), | ||
65 | 56 | ) | ||
66 | 57 | \end{verbatim} | ||
67 | 58 | |||
68 | 59 | \subsection{Sync your database} | ||
69 | 60 | |||
70 | 61 | From the directory with your project's \texttt{manage.py} file, enter \texttt{python manage.py syncdb} into a shell prompt to create PyDjWiki's tables. | ||
71 | 62 | |||
72 | 63 | The first time you do this with PyDjWiki installed, entries will be automatically created in the Namespace, Title, and Revision tables to provide a default front page (\texttt{meta/Front Page}) with sample content. This happens when PyDjWiki detects those three tables being created in the same \texttt{syncdb} run. If, for some reason, not all the tables are created at the same time, don't worry. The default data is stored in a fixture, so make sure all the necessary tables have been created and invoke \texttt{python manage.py loaddata pydjwikistart.xml} to load it in. | ||
73 | 64 | |||
74 | 65 | %\end{document} | ||
75 | 0 | \ No newline at end of file | 66 | \ No newline at end of file |
76 | 1 | 67 | ||
77 | === modified file 'doc/Wikitext Extensibility.tex' | |||
78 | --- wiki/pydjwiki/doc/Wikitext Extensibility.tex 2009-05-10 21:31:13 +0000 | |||
79 | +++ doc/Wikitext Extensibility.tex 2009-05-11 17:56:14 +0000 | |||
80 | @@ -88,7 +88,8 @@ | |||
81 | 88 | In this case, the revelant node becomes | 88 | In this case, the revelant node becomes |
82 | 89 | 89 | ||
83 | 90 | \begin{verbatim} | 90 | \begin{verbatim} |
85 | 91 | ExtensionNode (name="CHLOROPLETH" args={"base": "United States", ...} data="AL=9\nAK=3...") | 91 | ExtensionNode (name="CHLOROPLETH" args={"base": "United States", ...} |
86 | 92 | data="AL=9\nAK=3...") | ||
87 | 92 | \end{verbatim} | 93 | \end{verbatim} |
88 | 93 | 94 | ||
89 | 94 | Which evaluates to | 95 | Which evaluates to |
90 | @@ -96,9 +97,9 @@ | |||
91 | 96 | \begin{verbatim} | 97 | \begin{verbatim} |
92 | 97 | DocumentNode | 98 | DocumentNode |
93 | 98 | |--- ParagraphNode | 99 | |--- ParagraphNode |
95 | 99 | | |--- TextNode (text="The distribution of electoral votes is shown on the right.") | 100 | | |--- TextNode (text="The distribution ... is shown on the right.") |
96 | 100 | |--- FloatNode (class="Figure") | 101 | |--- FloatNode (class="Figure") |
98 | 101 | | |--- ImageNode (src="ext/chloropleth/United-States-c5dd1b2697720fe692c529688d3f4f8d.svg") | 102 | | |--- ImageNode (src="ext/chloropleth/United-States-hash.svg") |
99 | 102 | \end{verbatim} | 103 | \end{verbatim} |
100 | 103 | 104 | ||
101 | 104 | \section{Handler methods} | 105 | \section{Handler methods} |
102 | 105 | 106 | ||
103 | === renamed file 'wiki/pydjwiki/dpr.py' => 'dpr.py' | |||
104 | === renamed directory 'wiki/pydjwiki/dynamic' => 'dynamic' | |||
105 | === added directory 'fixtures' | |||
106 | === added file 'fixtures/pydjwikistart.xml' | |||
107 | --- fixtures/pydjwikistart.xml 1970-01-01 00:00:00 +0000 | |||
108 | +++ fixtures/pydjwikistart.xml 2009-05-11 17:56:48 +0000 | |||
109 | @@ -0,0 +1,4 @@ | |||
110 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
111 | 2 | <django-objects version="1.0"><object pk="1" model="pydjwiki.title"><field to="pydjwiki.namespace" name="namespace" rel="ManyToOneRel">1</field><field type="CharField" name="name">Front_Page</field><field type="BooleanField" name="active">True</field></object><object pk="1" model="pydjwiki.namespace"><field type="CharField" name="name">meta</field><field type="CharField" name="renderer">pydjwiki.render.parsers.creoleadd.CreoleAdditionsParser</field></object><object pk="1" model="pydjwiki.revision"><field to="pydjwiki.title" name="title" rel="ManyToOneRel">1</field><field type="DateTimeField" name="timestamp">2009-01-01 00:00:00</field><field to="auth.user" name="user" rel="ManyToOneRel">1</field><field type="TextField" name="content">== Welcome! == | ||
112 | 3 | |||
113 | 4 | Your wiki is up and running!</field><field type="CharField" name="comment">Wiki creation</field><field type="BooleanField" name="is_minor">False</field></object><object pk="4" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">allpages</field><field type="SlugField" name="key">all_pages</field><field type="CharField" name="view">pydjwiki.dynamic.allpages.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">All pages</field><field type="BooleanField" name="index">True</field></object><object pk="2" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">archive</field><field type="SlugField" name="key">archive</field><field type="CharField" name="view">pydjwiki.dynamic.archive.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">Archive</field><field type="BooleanField" name="index">False</field></object><object pk="6" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">edit</field><field type="SlugField" name="key">edit</field><field type="CharField" name="view">pydjwiki.dynamic.edit.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">Edit</field><field type="BooleanField" name="index">False</field></object><object pk="1" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">history</field><field type="SlugField" name="key">edit_history</field><field type="CharField" name="view">pydjwiki.dynamic.edithistory.view</field><field type="TextField" name="description">Displays the edit history for a page.</field><field type="CharField" name="title">Edit history</field><field type="BooleanField" name="index">False</field></object><object pk="5" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">index</field><field type="SlugField" name="key">index</field><field type="CharField" name="view">pydjwiki.dynamic.index.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">Dynamic pages</field><field type="BooleanField" name="index">True</field></object><object pk="3" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">linkindex</field><field type="SlugField" name="key">link_index</field><field type="CharField" name="view">pydjwiki.dynamic.linkindex.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">Index of links</field><field type="BooleanField" name="index">False</field></object><object pk="7" model="pydjwiki.dynamicpage"><field type="SlugField" name="url">linkshere</field><field type="SlugField" name="key">links_here</field><field type="CharField" name="view">pydjwiki.dynamic.linkshere.view</field><field type="TextField" name="description"></field><field type="CharField" name="title">Links to Page</field><field type="BooleanField" name="index">False</field></object></django-objects> | ||
114 | 0 | 5 | ||
115 | === renamed file 'wiki/pydjwiki/lib.py' => 'lib.py' | |||
116 | === renamed directory 'wiki/pydjwiki/management' => 'management' | |||
117 | === modified file 'management/__init__.py' | |||
118 | --- wiki/pydjwiki/management/__init__.py 2009-02-13 00:00:19 +0000 | |||
119 | +++ management/__init__.py 2009-05-11 02:42:53 +0000 | |||
120 | @@ -0,0 +1,33 @@ | |||
121 | 1 | from datetime import datetime | ||
122 | 2 | |||
123 | 3 | from django.db.models.signals import post_syncdb | ||
124 | 4 | |||
125 | 5 | from pydjwiki import models | ||
126 | 6 | |||
127 | 7 | |||
128 | 8 | def handle_syncdb(**kwargs): | ||
129 | 9 | from django.core.management import call_command | ||
130 | 10 | from django.contrib.auth.models import User | ||
131 | 11 | from pydjwiki.models import Namespace, Title, Revision | ||
132 | 12 | classes = Namespace, Title, Revision | ||
133 | 13 | if not all([m in kwargs['created_models'] for m in classes]): | ||
134 | 14 | return | ||
135 | 15 | # ns = Namespace(name='meta', | ||
136 | 16 | # renderer='pydjwiki.render.parsers.creoleadd.CreoleAdditionsParser') | ||
137 | 17 | # ns.save() | ||
138 | 18 | # title = Title(namespace=ns, name='Front_Page', active=False) | ||
139 | 19 | # title.save() | ||
140 | 20 | # content = '== Welcome! ==\n\nYour wiki is up and running!' | ||
141 | 21 | # user = User.objects.order_by('id')[0] | ||
142 | 22 | # rev = Revision(title=title, timestamp=datetime(2009, 1, 1), | ||
143 | 23 | # user=user, content=content, comment='Wiki creation') | ||
144 | 24 | # rev.save() | ||
145 | 25 | # title.active = True | ||
146 | 26 | # title.save() | ||
147 | 27 | # | ||
148 | 28 | # call_command('loaddata', 'dynamics.yaml') | ||
149 | 29 | call_command('loaddata', 'pydjwiki_start.xml') | ||
150 | 30 | |||
151 | 31 | |||
152 | 32 | post_syncdb.connect(handle_syncdb, sender=models, | ||
153 | 33 | dispatch_uid='pydjwiki.management.handle_syncdb') | ||
154 | 0 | \ No newline at end of file | 34 | \ No newline at end of file |
155 | 1 | 35 | ||
156 | === renamed file 'wiki/pydjwiki/models.py' => 'models.py' | |||
157 | --- wiki/pydjwiki/models.py 2009-05-10 19:49:55 +0000 | |||
158 | +++ models.py 2009-05-11 02:42:53 +0000 | |||
159 | @@ -265,10 +265,16 @@ | |||
160 | 265 | 265 | ||
161 | 266 | def update_revision_links(sender, **kwargs): | 266 | def update_revision_links(sender, **kwargs): |
162 | 267 | """Update Link table every time a Revision object is saved.""" | 267 | """Update Link table every time a Revision object is saved.""" |
164 | 268 | kwargs['instance'].title.rebuild_links() | 268 | try: |
165 | 269 | kwargs['instance'].title.rebuild_links() | ||
166 | 270 | except Exception: | ||
167 | 271 | pass | ||
168 | 269 | post_save.connect(update_revision_links, sender=Revision) | 272 | post_save.connect(update_revision_links, sender=Revision) |
169 | 270 | 273 | ||
170 | 271 | def remove_inactive_title_links(sender, **kwargs): | 274 | def remove_inactive_title_links(sender, **kwargs): |
171 | 272 | """Update Link table every time a Title object is saved.""" | 275 | """Update Link table every time a Title object is saved.""" |
173 | 273 | kwargs['instance'].rebuild_links() | 276 | try: |
174 | 277 | kwargs['instance'].rebuild_links() | ||
175 | 278 | except Exception: | ||
176 | 279 | pass | ||
177 | 274 | post_save.connect(remove_inactive_title_links, sender=Title) | 280 | post_save.connect(remove_inactive_title_links, sender=Title) |
178 | 275 | 281 | ||
179 | === renamed directory 'wiki/pydjwiki/render' => 'render' | |||
180 | === added file 'settings.py' | |||
181 | --- settings.py 1970-01-01 00:00:00 +0000 | |||
182 | +++ settings.py 2009-05-11 02:42:53 +0000 | |||
183 | @@ -0,0 +1,35 @@ | |||
184 | 1 | PYDJWIKI_NAMESPACE_REGEX = r'[a-z]+' | ||
185 | 2 | PYDJWIKI_TITLE_REGEX = r'[^\t\n\r\f\v?#]+' | ||
186 | 3 | PYDJWIKI_URL_REGEX = r'(?P<namespace>%s)/(?P<title>%s)(?:#(?P<anchor>.*))?$' \ | ||
187 | 4 | % (PYDJWIKI_NAMESPACE_REGEX, PYDJWIKI_TITLE_REGEX) | ||
188 | 5 | PYDJWIKI_MEDIA_PSEUDONS = 'pydj-media' | ||
189 | 6 | PYDJWIKI_SYSTEM_PSEUDONS = 'dynamic-page' | ||
190 | 7 | PYDJWIKI_DEFAULT_NS = 'dev' | ||
191 | 8 | PYDJWIKI_URL_ROOT = '/pydjwiki/' | ||
192 | 9 | PYDJWIKI_WIKI_NAME = 'PyDjWiki Development Wiki' | ||
193 | 10 | PYDJWIKI_FRONT_PAGE = 'meta/Front Page' | ||
194 | 11 | PYDJWIKI_FRONT_PAGE_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_FRONT_PAGE)) | ||
195 | 12 | PYDJWIKI_SPACE_FRIENDLY_USER_AGENTS = ( | ||
196 | 13 | # Modifying this setting requires a server restart. (Maybe.) | ||
197 | 14 | r'Firefox/3', | ||
198 | 15 | r'Opera', | ||
199 | 16 | ) | ||
200 | 17 | PYDJWIKI_MAIN_NS = 'article' | ||
201 | 18 | PYDJWIKI_SILENT_NAMESPACES = set(( | ||
202 | 19 | PYDJWIKI_MAIN_NS, | ||
203 | 20 | PYDJWIKI_SYSTEM_PSEUDONS, | ||
204 | 21 | )) | ||
205 | 22 | PYDJWIKI_SIDEBAR_TEMPLATES = ( | ||
206 | 23 | 'pydjwiki/sidebar/welcome.html', | ||
207 | 24 | 'pydjwiki/sidebar/links.html', | ||
208 | 25 | 'pydjwiki/sidebar/toc.html', | ||
209 | 26 | ) | ||
210 | 27 | PYDJWIKI_LOGIN_PAGE = '%s/login/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
211 | 28 | PYDJWIKI_LOGOUT_PAGE = '%s/logout/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
212 | 29 | PYDJWIKI_EDIT_PAGE = '%s/edit/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
213 | 30 | |||
214 | 31 | from pydjwiki.dpr import _DynamicURLRegistry | ||
215 | 32 | PYDJWIKI_DYNAMICS = _DynamicURLRegistry() | ||
216 | 33 | |||
217 | 34 | LOGIN_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_LOGIN_PAGE)) | ||
218 | 35 | LOGIN_REDIRECT_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_FRONT_PAGE)) | ||
219 | 0 | \ No newline at end of file | 36 | \ No newline at end of file |
220 | 1 | 37 | ||
221 | === renamed directory 'wiki/pydjwiki/templates' => 'templates' | |||
222 | === added file 'templates/base.html' | |||
223 | --- templates/base.html 1970-01-01 00:00:00 +0000 | |||
224 | +++ templates/base.html 2009-05-11 02:42:53 +0000 | |||
225 | @@ -0,0 +1,8 @@ | |||
226 | 1 | <html> | ||
227 | 2 | <head> | ||
228 | 3 | <title>{% block title %}{% endblock %}</title> | ||
229 | 4 | {% block extrahead %}{% endblock %}</head> | ||
230 | 5 | <body> | ||
231 | 6 | {% block content %}{% endblock %} | ||
232 | 7 | </body> | ||
233 | 8 | </html> | ||
234 | 0 | 9 | ||
235 | === renamed directory 'wiki/pydjwiki/templatetags' => 'templatetags' | |||
236 | === renamed file 'wiki/pydjwiki/urls.py' => 'urls.py' | |||
237 | === renamed file 'wiki/pydjwiki/views.py' => 'views.py' | |||
238 | === removed directory 'wiki' | |||
239 | === removed file 'wiki/__init__.py' | |||
240 | === removed file 'wiki/database' | |||
241 | 1 | Binary files wiki/database 2009-03-01 04:12:40 +0000 and wiki/database 1970-01-01 00:00:00 +0000 differ | 10 | Binary files wiki/database 2009-03-01 04:12:40 +0000 and wiki/database 1970-01-01 00:00:00 +0000 differ |
242 | === removed file 'wiki/manage.py' | |||
243 | --- wiki/manage.py 2009-03-11 03:25:19 +0000 | |||
244 | +++ wiki/manage.py 1970-01-01 00:00:00 +0000 | |||
245 | @@ -1,18 +0,0 @@ | |||
246 | 1 | #!/usr/bin/env python | ||
247 | 2 | |||
248 | 3 | from django.core.management import execute_manager | ||
249 | 4 | |||
250 | 5 | try: | ||
251 | 6 | import settings # Assumed to be in the same directory. | ||
252 | 7 | except ImportError: | ||
253 | 8 | import sys | ||
254 | 9 | sys.stderr.write("Error: Can't find the file 'settings.py' in the " | ||
255 | 10 | "directory containing %r. It appears you've customized " | ||
256 | 11 | "things.\nYou'll have to run django-admin.py, passing " | ||
257 | 12 | "it your settings module.\n(If the file settings.py " | ||
258 | 13 | "does indeed exist, it's causing an ImportError " | ||
259 | 14 | "somehow.)\n" % __file__) | ||
260 | 15 | sys.exit(1) | ||
261 | 16 | |||
262 | 17 | if __name__ == '__main__': | ||
263 | 18 | execute_manager(settings) | ||
264 | 19 | 0 | ||
265 | === removed directory 'wiki/pydjwiki' | |||
266 | === removed file 'wiki/settings.py' | |||
267 | --- wiki/settings.py 2009-03-09 20:04:00 +0000 | |||
268 | +++ wiki/settings.py 1970-01-01 00:00:00 +0000 | |||
269 | @@ -1,143 +0,0 @@ | |||
270 | 1 | # Django settings for wiki project. | ||
271 | 2 | |||
272 | 3 | def _relative(stub): | ||
273 | 4 | import os.path | ||
274 | 5 | dir = os.path.dirname(__file__) | ||
275 | 6 | return os.path.normpath(u'%s/%s' % (dir, stub)) | ||
276 | 7 | |||
277 | 8 | DEBUG = True | ||
278 | 9 | TEMPLATE_DEBUG = DEBUG | ||
279 | 10 | |||
280 | 11 | ADMINS = ( | ||
281 | 12 | ('Michael Nesvold', 'mdnesvold@gmail.com'), | ||
282 | 13 | ('Louis Wilson', 'louis.wilson@asu.edu'), | ||
283 | 14 | # ('Your Name', 'your_email@domain.com'), | ||
284 | 15 | ) | ||
285 | 16 | |||
286 | 17 | MANAGERS = ADMINS | ||
287 | 18 | |||
288 | 19 | DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', | ||
289 | 20 | # 'sqlite3' or 'oracle'. | ||
290 | 21 | DATABASE_NAME = _relative('database') | ||
291 | 22 | DATABASE_USER = '' # Not used with sqlite3. | ||
292 | 23 | DATABASE_PASSWORD = '' # Not used with sqlite3. | ||
293 | 24 | DATABASE_HOST = '' # Set to empty string for localhost. | ||
294 | 25 | # Not used with sqlite3. | ||
295 | 26 | DATABASE_PORT = '' # Set to empty string for default. | ||
296 | 27 | # Not used with sqlite3. | ||
297 | 28 | |||
298 | 29 | # Local time zone for this installation. Choices can be found here: | ||
299 | 30 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name | ||
300 | 31 | # although not all choices may be available on all operating systems. | ||
301 | 32 | # If running in a Windows environment this must be set to the same as | ||
302 | 33 | # your system time zone. | ||
303 | 34 | TIME_ZONE = 'America/Phoenix' | ||
304 | 35 | |||
305 | 36 | # Language code for this installation. All choices can be found here: | ||
306 | 37 | # http://www.i18nguy.com/unicode/language-identifiers.html | ||
307 | 38 | LANGUAGE_CODE = 'en-us' | ||
308 | 39 | |||
309 | 40 | SITE_ID = 1 | ||
310 | 41 | |||
311 | 42 | # If you set this to False, Django will make some optimizations so as | ||
312 | 43 | # not to load the internationalization machinery. | ||
313 | 44 | USE_I18N = False | ||
314 | 45 | |||
315 | 46 | # Absolute path to the directory that holds media. | ||
316 | 47 | # Example: "/home/media/media.lawrence.com/" | ||
317 | 48 | MEDIA_ROOT = '' | ||
318 | 49 | |||
319 | 50 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a | ||
320 | 51 | # trailing slash if there is a path component (optional in other cases). | ||
321 | 52 | # Examples: "http://media.lawrence.com", "http://example.com/media/" | ||
322 | 53 | MEDIA_URL = '' | ||
323 | 54 | |||
324 | 55 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure | ||
325 | 56 | # to use a trailing slash. | ||
326 | 57 | # Examples: "http://foo.com/media/", "/media/". | ||
327 | 58 | ADMIN_MEDIA_PREFIX = '/media/' | ||
328 | 59 | |||
329 | 60 | # Make this unique, and don't share it with anybody. | ||
330 | 61 | SECRET_KEY = 'gc%)t_l7ey9dpga(*4z+5nae+-%f%i6)#u85ps_=t=0j@pkndf' | ||
331 | 62 | |||
332 | 63 | # List of callables that know how to import templates from various | ||
333 | 64 | # sources. | ||
334 | 65 | TEMPLATE_LOADERS = ( | ||
335 | 66 | 'django.template.loaders.filesystem.load_template_source', | ||
336 | 67 | 'django.template.loaders.app_directories.load_template_source', | ||
337 | 68 | # 'django.template.loaders.eggs.load_template_source', | ||
338 | 69 | ) | ||
339 | 70 | |||
340 | 71 | MIDDLEWARE_CLASSES = ( | ||
341 | 72 | 'pydjwiki.djhooks.PyDjWikiMiddleware', | ||
342 | 73 | 'django.middleware.common.CommonMiddleware', | ||
343 | 74 | 'django.contrib.sessions.middleware.SessionMiddleware', | ||
344 | 75 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
345 | 76 | ) | ||
346 | 77 | |||
347 | 78 | ROOT_URLCONF = 'wiki.urls' | ||
348 | 79 | |||
349 | 80 | TEMPLATE_DIRS = ( | ||
350 | 81 | # Put strings here, like "/home/html/django_templates" or | ||
351 | 82 | # "C:/www/django/templates". | ||
352 | 83 | # Always use forward slashes, even on Windows. | ||
353 | 84 | # Don't forget to use absolute paths, not relative paths. | ||
354 | 85 | _relative('templates'), | ||
355 | 86 | _relative('pydjwiki/templates'), | ||
356 | 87 | _relative('pydjwiki/dev/templates'), | ||
357 | 88 | ) | ||
358 | 89 | |||
359 | 90 | TEMPLATE_CONTEXT_PROCESSORS = ( | ||
360 | 91 | 'django.core.context_processors.auth', # specified in default value | ||
361 | 92 | 'django.core.context_processors.debug', # specified in default value | ||
362 | 93 | 'django.core.context_processors.i18n', # specified in default value | ||
363 | 94 | 'django.core.context_processors.media', # specified in default value | ||
364 | 95 | 'pydjwiki.djhooks.context_processor_pydjwiki', | ||
365 | 96 | ) | ||
366 | 97 | |||
367 | 98 | INSTALLED_APPS = ( | ||
368 | 99 | 'django.contrib.admin', | ||
369 | 100 | 'django.contrib.admindocs', | ||
370 | 101 | 'django.contrib.auth', | ||
371 | 102 | 'django.contrib.contenttypes', | ||
372 | 103 | 'django.contrib.humanize', | ||
373 | 104 | 'django.contrib.sessions', | ||
374 | 105 | # 'django.contrib.sites', | ||
375 | 106 | 'wiki.pydjwiki', | ||
376 | 107 | ) | ||
377 | 108 | |||
378 | 109 | PYDJWIKI_NAMESPACE_REGEX = r'[a-z]+' | ||
379 | 110 | PYDJWIKI_TITLE_REGEX = r'[^\t\n\r\f\v?#]+' | ||
380 | 111 | PYDJWIKI_URL_REGEX = r'(?P<namespace>%s)/(?P<title>%s)(?:#(?P<anchor>.*))?$' \ | ||
381 | 112 | % (PYDJWIKI_NAMESPACE_REGEX, PYDJWIKI_TITLE_REGEX) | ||
382 | 113 | PYDJWIKI_MEDIA_PSEUDONS = 'pydj-media' | ||
383 | 114 | PYDJWIKI_SYSTEM_PSEUDONS = 'dynamic-page' | ||
384 | 115 | PYDJWIKI_DEFAULT_NS = 'dev' | ||
385 | 116 | PYDJWIKI_URL_ROOT = '/pydjwiki/' | ||
386 | 117 | PYDJWIKI_WIKI_NAME = 'PyDjWiki Development Wiki' | ||
387 | 118 | PYDJWIKI_FRONT_PAGE = 'meta/Front Page' | ||
388 | 119 | PYDJWIKI_FRONT_PAGE_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_FRONT_PAGE)) | ||
389 | 120 | PYDJWIKI_SPACE_FRIENDLY_USER_AGENTS = ( | ||
390 | 121 | # Modifying this setting requires a server restart. (Maybe.) | ||
391 | 122 | r'Firefox/3', | ||
392 | 123 | r'Opera', | ||
393 | 124 | ) | ||
394 | 125 | PYDJWIKI_MAIN_NS = 'article' | ||
395 | 126 | PYDJWIKI_SILENT_NAMESPACES = set(( | ||
396 | 127 | PYDJWIKI_MAIN_NS, | ||
397 | 128 | PYDJWIKI_SYSTEM_PSEUDONS, | ||
398 | 129 | )) | ||
399 | 130 | PYDJWIKI_SIDEBAR_TEMPLATES = ( | ||
400 | 131 | 'pydjwiki/sidebar/welcome.html', | ||
401 | 132 | 'pydjwiki/sidebar/links.html', | ||
402 | 133 | 'pydjwiki/sidebar/toc.html', | ||
403 | 134 | ) | ||
404 | 135 | PYDJWIKI_LOGIN_PAGE = '%s/login/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
405 | 136 | PYDJWIKI_LOGOUT_PAGE = '%s/logout/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
406 | 137 | PYDJWIKI_EDIT_PAGE = '%s/edit/' % PYDJWIKI_SYSTEM_PSEUDONS | ||
407 | 138 | |||
408 | 139 | from pydjwiki.dpr import _DynamicURLRegistry | ||
409 | 140 | PYDJWIKI_DYNAMICS = _DynamicURLRegistry() | ||
410 | 141 | |||
411 | 142 | LOGIN_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_LOGIN_PAGE)) | ||
412 | 143 | LOGIN_REDIRECT_URL = ''.join((PYDJWIKI_URL_ROOT, PYDJWIKI_FRONT_PAGE)) | ||
413 | 144 | 0 | ||
414 | === removed directory 'wiki/templates' | |||
415 | === removed directory 'wiki/templates/admin' | |||
416 | === removed file 'wiki/templates/admin/base.html' | |||
417 | --- wiki/templates/admin/base.html 2008-12-12 07:03:52 +0000 | |||
418 | +++ wiki/templates/admin/base.html 1970-01-01 00:00:00 +0000 | |||
419 | @@ -1,55 +0,0 @@ | |||
420 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
421 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> | ||
422 | 3 | <head> | ||
423 | 4 | <title>{% block title %}{% endblock %}</title> | ||
424 | 5 | <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /> | ||
425 | 6 | {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} | ||
426 | 7 | {% block extrastyle %}{% endblock %} | ||
427 | 8 | {% block extrahead %}{% endblock %} | ||
428 | 9 | {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} | ||
429 | 10 | </head> | ||
430 | 11 | {% load i18n %} | ||
431 | 12 | |||
432 | 13 | <body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"> | ||
433 | 14 | |||
434 | 15 | <!-- Container --> | ||
435 | 16 | <div id="container"> | ||
436 | 17 | |||
437 | 18 | {% if not is_popup %} | ||
438 | 19 | <!-- Header --> | ||
439 | 20 | <div id="header"> | ||
440 | 21 | <div id="branding"> | ||
441 | 22 | {% block branding %}{% endblock %} | ||
442 | 23 | </div> | ||
443 | 24 | {% if user.is_authenticated and user.is_staff %} | ||
444 | 25 | <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div> | ||
445 | 26 | {% endif %} | ||
446 | 27 | {% block nav-global %}{% endblock %} | ||
447 | 28 | </div> | ||
448 | 29 | <!-- END Header --> | ||
449 | 30 | {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} › {{ title|escape }}{% endif %}</div>{% endblock %} | ||
450 | 31 | {% endif %} | ||
451 | 32 | |||
452 | 33 | {% if messages %} | ||
453 | 34 | <ul class="messagelist">{% for message in messages %}<li>{{ message|escape }}</li>{% endfor %}</ul> | ||
454 | 35 | {% endif %} | ||
455 | 36 | |||
456 | 37 | <!-- Content --> | ||
457 | 38 | <div id="content" class="{% block coltype %}colM{% endblock %}"> | ||
458 | 39 | {% block pretitle %}{% endblock %} | ||
459 | 40 | {% block content_title %}{% if title %}<h1>{{ title|escape }}</h1>{% endif %}{% endblock %} | ||
460 | 41 | {% block content %} | ||
461 | 42 | {% block object-tools %}{% endblock %} | ||
462 | 43 | {{ content }} | ||
463 | 44 | {% endblock %} | ||
464 | 45 | {% block sidebar %}{% endblock %} | ||
465 | 46 | <br class="clear" /> | ||
466 | 47 | </div> | ||
467 | 48 | <!-- END Content --> | ||
468 | 49 | |||
469 | 50 | {% block footer %}<div id="footer"></div>{% endblock %} | ||
470 | 51 | </div> | ||
471 | 52 | <!-- END Container --> | ||
472 | 53 | |||
473 | 54 | </body> | ||
474 | 55 | </html> | ||
475 | 56 | 0 | ||
476 | === removed file 'wiki/templates/admin/base_site.html' | |||
477 | --- wiki/templates/admin/base_site.html 2008-12-12 07:03:52 +0000 | |||
478 | +++ wiki/templates/admin/base_site.html 1970-01-01 00:00:00 +0000 | |||
479 | @@ -1,10 +0,0 @@ | |||
480 | 1 | {% extends "admin/base.html" %} | ||
481 | 2 | {% load i18n %} | ||
482 | 3 | |||
483 | 4 | {% block title %}{{ title }} | {% trans 'PyDjWiki admin' %}{% endblock %} | ||
484 | 5 | |||
485 | 6 | {% block branding %} | ||
486 | 7 | <h1 id="site-name">{% trans 'PyDjWiki administration' %}</h1> | ||
487 | 8 | {% endblock %} | ||
488 | 9 | |||
489 | 10 | {% block nav-global %}{% endblock %} | ||
490 | 11 | 0 | ||
491 | === removed file 'wiki/templates/base.html' | |||
492 | --- wiki/templates/base.html 2009-02-16 20:48:55 +0000 | |||
493 | +++ wiki/templates/base.html 1970-01-01 00:00:00 +0000 | |||
494 | @@ -1,8 +0,0 @@ | |||
495 | 1 | <html> | ||
496 | 2 | <head> | ||
497 | 3 | <title>{% block title %}{% endblock %}</title> | ||
498 | 4 | {% block extrahead %}{% endblock %}</head> | ||
499 | 5 | <body> | ||
500 | 6 | {% block content %}{% endblock %} | ||
501 | 7 | </body> | ||
502 | 8 | </html> | ||
503 | 9 | 0 | ||
504 | === removed file 'wiki/urls.py' | |||
505 | --- wiki/urls.py 2009-03-08 21:09:32 +0000 | |||
506 | +++ wiki/urls.py 1970-01-01 00:00:00 +0000 | |||
507 | @@ -1,20 +0,0 @@ | |||
508 | 1 | from django.conf import settings | ||
509 | 2 | from django.conf.urls.defaults import * | ||
510 | 3 | |||
511 | 4 | # Documentation | ||
512 | 5 | urlpatterns = patterns('', | ||
513 | 6 | (r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||
514 | 7 | (r'^%s' % settings.PYDJWIKI_URL_ROOT[1:], include('wiki.pydjwiki.urls')), | ||
515 | 8 | ) | ||
516 | 9 | |||
517 | 10 | # Redirect to /pydjwiki by default | ||
518 | 11 | urlpatterns += patterns('django.views.generic.simple', | ||
519 | 12 | (r'^$', 'redirect_to', {'url': '/pydjwiki/'}), | ||
520 | 13 | ) | ||
521 | 14 | |||
522 | 15 | # Admin site | ||
523 | 16 | from django.contrib import admin | ||
524 | 17 | admin.autodiscover() | ||
525 | 18 | urlpatterns += patterns('', | ||
526 | 19 | (r'^admin/(.*)', admin.site.root) | ||
527 | 20 | ) |
You probably want to double-check me that the installation instructions actually work.