Django Wiki
Django Wiki
Django Wiki
Release 0.3.1
Benjamin Bach
1 Installation 1
2 Release notes 5
3 Plugins 15
4 Customization 17
5 Settings 19
6 Developer guide 25
8 django-wiki 33
i
ii
CHAPTER 1
Installation
For image processing, django-wiki uses the Pillow library (a fork of PIL). The preferred method should be to get a
system-wide, pre-compiled version of Pillow, for instance by getting the binaries from your Linux distribution repos.
1.1.1 Debian/Ubuntu
You need to get development libraries which Pip needs for compiling:
After that, install with sudo pip install Pillow. You might as well install Pillow system-wide, because
there are little version-specific dependencies in Django applications when it comes to Pillow, and having multiple
installations of the very same package is a bad practice in this case.
Ethan Tira-Thompson has created ports for OS X and made them available as a .dmg installer. Download and install
the universal combo package here.
Once you have the packages installed, you can proceed to the pip installation. PIL will automatically pick up these
libraries and compile them for django use.
1.2 Installing
1
django-wiki Documentation, Release 0.3.1
Install directly from Github (in case you have no worries about deploying our master branch directly):
pip install git+git://github.com/django-wiki/django-wiki.git
1.3 Upgrading
1.4 Configuration
The following applications should be listed - NB! it’s important to maintain the order due to database relational
constraints:
'django.contrib.sites',
'django.contrib.humanize',
'django_nyt',
'mptt',
'sekizai',
'sorl.thumbnail',
'wiki.apps.WikiConfig',
'wiki.plugins.attachments.apps.AttachmentsConfig',
'wiki.plugins.notifications.apps.NotificationsConfig',
'wiki.plugins.images.apps.ImagesConfig',
'wiki.plugins.macros.apps.MacrosConfig',
1.4.2 Database
2 Chapter 1. Installation
django-wiki Documentation, Release 0.3.1
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
"sekizai.context_processors.sekizai",
],
},
},
]
If you’re working with fresh Django installation, you need to set the SITE_ID
SITE_ID = 1
There is a limited account handling included to allow users to sign up. Its settings are shown below with their default
values. To switch off account handling entirely, set WIKI_ACCOUNT_HANDLING = False.
WIKI_ACCOUNT_HANDLING = True
WIKI_ACCOUNT_SIGNUP_ALLOWED = True
After a user is logged in, they will be redirected to the value of LOGIN_REDIRECT_URL, which you can configure
in your project settings to point to the root article:
from django.core.urlresolvers import reverse_lazy
LOGIN_REDIRECT_URL = reverse_lazy('wiki:get', kwargs={'path': ''})
To integrate the wiki to your existing application, you should add the following lines at the end of your project’s
urls.py.
from wiki.urls import get_pattern as get_wiki_pattern
from django_nyt.urls import get_pattern as get_nyt_pattern
urlpatterns += [
url(r'^notifications/', get_nyt_pattern()),
url(r'', get_wiki_pattern())
]
The above line puts the wiki in / so it’s important to put it at the end of your urlconf. You can also put it in /wiki by
putting '^wiki/' as the pattern.
Note: If you are running manage.py runserver, you need to have static files and media files from
STATIC_ROOT and MEDIA_ROOT served by the development server. STATIC_ROOT is automatically served, but
you have to add MEDIA_ROOT manually:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
1.4. Configuration 3
django-wiki Documentation, Release 0.3.1
4 Chapter 1. Installation
CHAPTER 2
Release notes
The current release series 0.3 supports Django 1.11. As with the upstream Django release, 0.3 will be the last series
with Python 2.7 support.
The next series 0.4 will support Django 1.11 and Django 2.x and be for Python 3.4+.
• Fix error messages of missing migrations due to inconsistent change of on_delete on some model fields #776
5
django-wiki Documentation, Release 0.3.1
• >90% completed: Chinese, French, German, Russian, Spanish, Danish, Korean, Polish, Portuguese (Brazilian),
Slovak, Spanish
2.3.2 Added
• Search choice between either current or global tree (Christian Duvholt) #580 #731
• New bootstrapped image insert dialog (Frank Loemker) #628
• Allow the HTML tag <hr> (Frank Loemker) #629
• Global History overview of page revisions (Frank Loemker and Maximilien Cuony) #627
• Move article support with redirects (Frank Loemker) #640
• Django 1.11 compatibility (Luke Plant) #634
• Crop paginator window when there are >9 pages in a list (Frank Loemker) #646
• Extended syntax for attachment macro: [attachment:id title:"text" size] (Frank Loemker)
#678
• Add Sphinx documentation for plugin settings (Frank Loemker) #681
• Show “log out” in menu when account handling is disabled (jenda1) #691
• Markdown tag with wiki paths now support fragments like [Click Here](wiki:/path#header)
(Frank Loemker) #701
2.3.3 Changed
• Test refactor: Use django-functest and separate WebTest from Selenium (Luke Plant) #634
• Repo refactor: Moved wiki package to src/ folder and test code to tests/ #631
• Render django.contrib.messages with template tag and inclusion template: Configurable and bootstrap 3 com-
patible (Benjamin Bach and Frank Loemker) #654
• Don’t hardcode redirect url in account update view (Benjamin Bach) #650
• Python 3.6 support added to test matrix (Benjamin Bach) #664
• Keep CSS global namespace clean, refactor CSS rule label -> .wiki-label label (Christian Duvholt)
#679
• Plugins can whitelist HTML tags and attributes (jenda1) #700
• Optimizations to fundamental permission lookup managers (Christian Duvholt) #714
• Code quality upgrade, remove obsolete code, linting and tidying up (Mads Jensen) #797, #705, #707, #716,
#717, #718, #719, #720, #721, #722, #724, #725, #726, #727, #728, #730, #732, #733, #735, #736, #737, #738,
#741, #743, #743, #756, #757
• Added AppConfig class for all plugins (Raffaele Salmaso) #758
• Explicit on_delete for all ForeignKey fields (Raffaele Salmaso) #759
• Django 2.0 preparation: atomic=False for 3 migrations that rename tables/fields (Raffaele Salmaso) #760
• Set dependency django-nyt<1.1 to avoid future breakage (Benjamin Bach) #761
2.3.4 Fixed
• Removed exception catch all in URLPath.delete_subtree which silenced errors while delete articles
with descendents
• Fix article settings page in Django 1.11 (Frank Loemker) #682
• Fix upstream MPTT breaking deletion of articles from django-admin (Frank Loemker) #683
• Wrong HTML attribute ‘type’ on search result page (Geoff Clapp) #698
• Fix restoring of attachments and other RevisionPlugin types after deletion (Frank Loemker) #672
• Allowing <sup> because of footnotes (Frank Loemker) #750
• Hunted down unclosed HTML tags #750 (Mads Jensen) #741
• Remove wiki.decorators.json_view, fixes server errors when resolving 404 links #604
• Replace usage of render_to_response() with render() #606
• Fix memory leak #609 and #611 (obtroston)
• Scroll bars and display area fixed for code blocks #601 and #608 (Branko Majic)
• Option WIKI_MARKDOWN_SANITIZE_HTML skips Bleach (warning: Don’t use for untrusted code) #610
(Michal Hozza)
• Lowercase slugs when creating new pages with [[Like This]] #595 (Eric Clack)
• Fix issues related to Bleach before Markdown processing esp. pertaining > characters. #596
• Remove wiki.plugins.mediawikiimport #597
• Pretty up the highligted code’s line enumeration #598
• Customize codehilite in order to wrap highlighted code with scrollbars #598
Please use new setting WIKI_MARKDOWN_HTML_WHITELIST and set a list of allowed tags to customize behavior.
• Remove unwanted items from default menu when WIKI_ACCOUNT_HANDLING = False. #545
• Fix broken soft-deletion and restoring of images, and “set revision” functionality #533
• Added responsiveness to tables by use of Bootstrap table-responsive class #552
Warning: If you are upgrading from a previous release, please ensure that you pass through the 0.0.24 release
because it contains the final migrations necessary before entering the django-wiki 0.1+ migration tree.
If you are using django 1.7+ and have an old installation of django-wiki (which should be impossible since it
wouldn’t run) please downgrade to 1.6 as follows:
$ pip install wiki\<0.1 --upgrade # Latest 0.0.24 release
$ pip install django\<1.7 # Downgrade django if necessary
$ python manage.py migrate # Run 0.0.24 migrations
$ pip install wiki\<0.2 --upgrade # Upgrade to latest 0.1 series
$ python manage.py migrate --delete-ghost-migrations # Run migrations again,
# removing the (ghost)
# migrations from previous
# release
2.10.
$ # django-wiki
Feel free to0.1.2
upgrade Django again 9
django-wiki Documentation, Release 0.3.1
Supported
• Python 2.7, 3.3, 3.4, 3.5 (3.2 is not supported)
• Django 1.5, 1.6, 1.7, 1.8, 1.9
• Django < 1.7 still needs South, and migration trees are kept until next major release.
wiki.VERSION as tuple
We want to follow Django’s way of enumerating versions. If you want the old string version, use wiki.
__version__.
Plugin API
Since Django 1.8 has started making warnings about patterns being deprecated, we’ve decided to stop using them by
default. Thus, as with the future Django 2.0, we will use lists of url objects to store the urlconf of plugins. All the
bundled plugins have been updated to reflect the change.
Django-mptt
We now depend on django-mptt 0.7.2+ for Django 1.8 compatibility.
This release is a transitional release for anyone still using an older version of django-wiki. The code base has been
heavily refactored and this is hopefully the final release.
Warning: 0.0.24 is mainly a transitional release, but new features and bug fixes are included, too.
Compatibility
• Django 1.5, 1.6 (That means Django 1.7 is not yet fully supported)
• South 1.0+ (if you are on an older South, you need to upgrade)
• Python 2.6, 2.7, 3.3, 3.4
2.13.1 Upgrading
During the upgrade, notice that django-nyt is installed. This replaces the previously bundled django_notify and you
need to make a few changes in your settings and urls.
In settings.INSTALLED_APPS, replace “django_notify” with “django_nyt”. Then open up your project’s url-
conf and make sure you have something that looks like the following:
Notice that we are importing from django_nyt.urls and no longer django_notify and that the function is renamed to
get_nyt_pattern.
After making these changes, you should run migrations.
Notifications fixed
In past history, django-wiki has shipped with a very weird migration. It caused for the notifications plugin’s table of
article subscriptions to be removed. This is fixed in the new migrations and the table should be safely restored in case
it was missing.
However, you may want to bootstrap subscription notifications in case you have run into this failed migration. You
can ensure that all owners and editors of articles receive notifications using the following management command:
python manage.py wiki_notifications_create_defaults
2.13.2 Troubleshooting
If you have been running from the git master branch, you may experience problems and need to re-run the migrations
entirely.
If you get DatabaseError: no such table: notifications_articlesubscription, you have been running django-wiki version
with differently named tables. Don’t worry, just fake the backwards migration:
A new release 0.0.24.4 is out and has fixes for the Django loaddata management command such that you can create
dumps and restore the dump. Notice, though, that loaddata only works for Django 1.7+.
Django 1.9 support is available in the current master, please help get a 0.1 released by giving feed back in the last
remaining issues:
https://github.com/django-wiki/django-wiki/milestones/0.1
Django 1.8 support is very ready and 0.1 is right on the doorstep now.
Plugins
15
django-wiki Documentation, Release 0.3.1
16 Chapter 3. Plugins
CHAPTER 4
Customization
See Settings for the settings that can be used to configure django-wiki. Other ways to customize django-wiki for your
use are listed below.
4.1 Templates
{% extends "wiki/base_site.html" %}
{% block wiki_header_branding %}
<a class="navbar-brand" href="/">Your brand</a>
{% endblock %}
{% block wiki_header_navlinks %}
<ul class="nav navbar-nav">
<li class="active"><a href="{% url 'wiki:root' %}">Wiki</a></li>
17
django-wiki Documentation, Release 0.3.1
</ul>
{% endblock %}
18 Chapter 4. Customization
CHAPTER 5
Settings
The following settings are available for configuration through your project. All settings are customized by prefixing
WIKI_, so for instance URL_CASE_SENSITIVE should be configured as WIKI_URL_CASE_SENSITIVE. For
plugins the prefix is WIKI_PLUGINNAME_, e.g. WIKI_IMAGES for the images plugin.
wiki.conf.settings.ACCOUNT_HANDLING = True
Sign up, login and logout views should be accessible.
wiki.conf.settings.ACCOUNT_SIGNUP_ALLOWED = True
Signup allowed? If it’s not allowed, logged in superusers can still access the signup page to create new users.
wiki.conf.settings.ANONYMOUS = True
Treat anonymous (i.e. non logged in) users as the “other” user group.
wiki.conf.settings.ANONYMOUS_CREATE = False
Globally enable create access for anonymous users. Defaults to ANONYMOUS_WRITE.
wiki.conf.settings.ANONYMOUS_UPLOAD = False
Default setting to allow anonymous users upload access. Used in plugins.attachments and plugins.images, and
can be overwritten in these plugins.
wiki.conf.settings.ANONYMOUS_WRITE = True
Globally enable write access for anonymous users, if true anonymous users will be treated as the others_write
boolean field on models.Article.
wiki.conf.settings.CACHE_TIMEOUT = 600
Seconds of timeout before renewing the article cache. Articles are automatically renewed whenever an edit
occurs but article content may be generated from other objects that are changed.
wiki.conf.settings.CAN_ADMIN = None
A function returning True/False if a user has permission to create new groups and users for the wiki.
wiki.conf.settings.CAN_ASSIGN = None
A function returning True/False if a user has permission to assign permissions on an article. Relevance: Chang-
ing owner and group membership.
19
django-wiki Documentation, Release 0.3.1
wiki.conf.settings.CAN_ASSIGN_OWNER = None
A function returning True/False if the owner of an article has permission to change the group to a user’s own
groups. Relevance: Changing group membership.
wiki.conf.settings.CAN_CHANGE_PERMISSIONS = None
A function returning True/False if a user has permission to change read/write access for groups and others.
wiki.conf.settings.CAN_DELETE = None
Specifies if a user has access to soft deletion of articles.
wiki.conf.settings.CAN_MODERATE = None
A function returning True/False if a user has permission to change moderate, ie. lock articles and permanently
delete content.
wiki.conf.settings.CAN_READ = None
A function returning True/False if a user has permission to read contents of an article and plugins. Relevance:
Viewing articles and plugins.
wiki.conf.settings.CAN_WRITE = None
A function returning True/False if a user has permission to change contents, i.e. add new revisions to an article.
Often, plugins also use this. Relevance: Editing articles, changing revisions, editing plugins.
wiki.conf.settings.CHECK_SLUG_URL_AVAILABLE = True
When True, this blocks new slugs that resolve to non-wiki views, stopping users creating articles that conflict
with overlapping URLs from other apps.
wiki.conf.settings.EDITOR = u'wiki.editors.markitup.MarkItUp'
The editor class to use – maybe a 3rd party or your own. . . ? You can always extend the built-in editor and
customize it!
wiki.conf.settings.GROUP_MODEL = u'auth.Group'
Choose the Group model to use for permission handling. Defaults to django’s auth.Group.
wiki.conf.settings.LOG_IPS_ANONYMOUS = True
Do we want to log IPs of anonymous users?
wiki.conf.settings.LOG_IPS_USERS = False
Do we want to log IPs of logged in users?
wiki.conf.settings.LOST_AND_FOUND_SLUG = u'lost-and-found'
This slug is used in URLPath if an article has been deleted. The children of the URLPath of that article are
moved to lost and found. They keep their permissions and all their content.
wiki.conf.settings.MARKDOWN_HTML_ATTRIBUTES = {u'a': [u'href', u'title', u'class', u'id'],
Dictionary of allowed attributes in Markdown article contents.
wiki.conf.settings.MARKDOWN_HTML_STYLES = []
Allowed inline styles in Markdown article contents, default is no styles (empty list).
wiki.conf.settings.MARKDOWN_HTML_WHITELIST = [u'a', u'abbr', u'acronym', u'b', u'blockquote
List of allowed tags in Markdown article contents.
wiki.conf.settings.MARKDOWN_KWARGS = {u'extension_configs': {u'toc': {u'title': <django.
Arguments for the Markdown instance, for instance a list of extensions to use. See: https://pythonhosted.org/
Markdown/extensions/index.html
To set a custom title for TOC’s:
20 Chapter 5. Settings
django-wiki Documentation, Release 0.3.1
wiki.conf.settings.MARKDOWN_SANITIZE_HTML = True
Whether to use Bleach or not. It’s not recommended to turn this off unless you know what you’re doing and you
don’t want to use the other options.
wiki.conf.settings.MESSAGE_TAG_CSS_CLASS = {'debug': u'alert alert-info', 'error': u'aler
Mapping from message.tag to bootstrap class names.
wiki.conf.settings.REVISIONS_MINUTES_LOOKBACK = 2
Number of minutes to look back for looking up REVISIONS_PER_MINUTES and
REVISIONS_PER_MINUTES_ANONYMOUS.
wiki.conf.settings.REVISIONS_PER_HOUR = 60
Maximum allowed revisions per hour for any given user or IP.
wiki.conf.settings.REVISIONS_PER_HOUR_ANONYMOUS = 10
Maximum allowed revisions per hour for any anonymous user and any IP.
wiki.conf.settings.REVISIONS_PER_MINUTES = 5
Maximum allowed revisions per minute for any given user or IP.
wiki.conf.settings.REVISIONS_PER_MINUTES_ANONYMOUS = 2
Maximum allowed revisions per minute for any anonymous user and any IP.
wiki.conf.settings.SEARCH_VIEW = u'wiki.views.article.SearchView'
Search view - dotted path denoting where the search view Class is located.
wiki.conf.settings.SHOW_MAX_CHILDREN = 20
Maximum amount of children to display in a menu before showing “+more”. NEVER set this to 0 as it will
wrongly inform the user that there are no children and for instance that an article can be safely deleted.
wiki.conf.settings.STORAGE_BACKEND = <django.core.files.storage.DefaultStorage object>
Default Django storage backend to use for images, attachments etc.
wiki.conf.settings.URL_CASE_SENSITIVE = False
Should urls be case sensitive?
wiki.conf.settings.URL_CONFIG_CLASS = u'wiki.urls.WikiURLPatterns'
Dotted name of the class used to construct urlpatterns for the wiki. Default is wiki.urls.WikiURLPatterns. To
customize urls or view handlers, you can derive from this.
wiki.conf.settings.USE_BOOTSTRAP_SELECT_WIDGET = True
User Bootstrap’s select widget. Switch off if you’re not using Bootstrap!
wiki.conf.settings.USE_SENDFILE = False
Use django-sendfile for sending out files? Otherwise the whole file is first read into memory and than send with
a mime type based on the file.
to ensure that your web server never actually executes some script. The extensions are case insensitive. You are
asked to explicitly enter all file extensions that you want to allow. For your own safety.
wiki.plugins.attachments.settings.STORAGE_BACKEND = <django.core.files.storage.DefaultStora
Storage backend to use, default is to use the same as the rest of the wiki, which is set in
WIKI_STORAGE_BACKEND, but you can override it with WIKI_ATTACHMENTS_STORAGE_BACKEND.
wiki.plugins.attachments.settings.UPLOAD_PATH = u'wiki/attachments/%aid/'
Where to store article attachments, relative to MEDIA_ROOT. You should NEVER enable directory indexing in
MEDIA_ROOT/UPLOAD_PATH! Actually, you can completely disable serving it, if you want. Files are sent to
the user through a Django view that reads and streams a file.
wiki.plugins.attachments.settings.UPLOAD_PATH_OBSCURIFY = True
Should the upload path be obscurified? If so, a random hash will be added to the path such that someone can
not guess the location of files (if you have restricted permissions and the files are still located within the web
server’s file system).
wiki.plugins.attachments.settings.USE_LOCAL_PATH = True
Important for e.g. S3 backends: If your storage backend does not have a .path attribute for the file, but only a
.url attribute, you should use False. This will reveal the direct download URL so it does not work perfectly for
files you wish to be kept private.
22 Chapter 5. Settings
django-wiki Documentation, Release 0.3.1
24 Chapter 5. Settings
CHAPTER 6
Developer guide
• Fork and clone the django-wiki repo from Github, cd into it.
• Create and activate a virtualenv for developing django-wiki. Ensure you are using recent setuptools and pip.
• Install the requirements:
6.3 Tests
25
django-wiki Documentation, Release 0.3.1
INCLUDE_SELENIUM_TESTS=1 tox
Warning: Views should be written so that as far as possible they work without Javascript, and can be tested using
the fast WebTest method, rather than relying on the slow and fragile Selenium method. Selenium tests are not run
by default.
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants
to implement it.
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to
whoever wants to implement it.
Django-wiki could always use more documentation, whether as part of the official django-wiki docs, in docstrings, or
even on the web in blog posts, articles, and such.
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up
your fork for local development:
$ mkvirtualenv django-wiki
$ cd django-wiki/
$ python setup.py develop
$ tox -e lint
$ py.test # Run tests in current environment
$ tox
To get flake8 and tox, just pip install them into your virtualenv.
6. Commit your changes and push your branch to GitHub:
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function
with a docstring, and add the feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.4, 3.5, 3.6, and for PyPy. Check https://travis-ci.org/django-wiki/
django-wiki/pull_requests and make sure that the tests pass for all supported Python versions.
6.7 Tips
$ py.test tests.test_django-wiki
6.8 Roadmap
The best way to contribute is to use our Github issue list to look at current wishes. The list is found here:
https://github.com/django-wiki/django-wiki/issues/
If you want to add a feature, consider writing a plugin. Please create an issue to discuss whether your plugin idea is a
core plugin (wiki.plugins.*) or external plugin. If there are additions needed to the plugin API, we can discuss
that as well! A discussion is always welcome in a Github issue.
Generally speaking, we need more unit tests to improve coverage, and new features will not be accepted without tests.
To add more stuff to the project without tests wouldn’t be fair to the project or your hard work. We use coverage
metrics to see that each new contribution does not significantly impact test coverage.
7.1 FAQ
7.1.2 Q: Why do I keep getting “This slug conflicts with an existing URL.”
29
django-wiki Documentation, Release 0.3.1
This page describes how to embed the Disqus comment system on each wiki page.
Put the following as wiki/base.html somewhere in your TEMPLATE_DIRS:
{% extends "wiki/base_site.html" %}
{% load sekizai_tags %}
{% block wiki_body %}
{{ block.super }}
{% block wiki_footer_logo %}
{% endblock wiki_footer_logo %}
{% if selected_tab == 'view' %}
{% addtoblock "js" %}
<script type="text/javascript">
(function(){
$("#wiki-footer p").eq(0).after('<div id="disqus_thread"></div>')
})();
var disqus_shortname = 'your_disqus_shortname';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.
˓→async = true;
})();
</script>
{% endaddtoblock %}
{% endif %}
{% endblock wiki_body %}
1. Account handling: There are simple views that handle login, logout and signup. They are on by default. Make
sure to set settings.LOGIN_URL to point to your login page as many wiki views may redirect to a login
page.
2. Syntax highlighting: Python-Markdown has a pre-shipped codehilite extension which works perfectly, so add
something like:
WIKI_MARKDOWN_KWARGS = {
'extensions': [
'footnotes',
'attr_list',
'headerid',
'extra',
'codehilite',
]
}
to your settings. Currently, django-wiki ships with a stylesheet that already has the syntax highlighting CSS rules
built-in. Oh, and you need to ensure pip install pygments because Pygments is what the codehilite
extension is using!
3. Project Templates: Create new django-wiki projects quickly and easily using django-wiki project templates
https://github.com/django-wiki/django-wiki-project-template
django-wiki
Django-wiki has almost fully translated into 7 languages, apart from the default (English). But please help out in
adding more languages! It’s very easy, you don’t even need to be a programmer.
https://www.transifex.com/django-wiki/django-wiki/
8.3 Demo
A demo running the latest master is available here, sign up for an account to see the notification system.
https://demo.django.wiki
33
django-wiki Documentation, Release 0.3.1
8.4 Community
Please use our IRC or mailing list (google group) for getting in touch on development and support. Please do not email
developers asking for personal support.
• #django-wiki on irc.freenode.net
• django-wiki@googlegroups.com
• twitter:djangowiki
Currently, the model API is subject to smaller changes, and the plugin API seems pretty stable.
In order to customize the wiki, best idea is to override templates and create your own template tags. Do not make your
own hard copy of this repository in order to fiddle with internal parts of the wiki – this strategy will lead you to lose
out on future updates with highly improved features and plugins. Possibly security updates as well!
The release cycle has already begun, so you can administer django-wiki through Pypi and pip.
All views are class-based, however don’t take it as an encouragement to extend them, unless you are prepared to
modify both templates and view classes every time there is an update.
8.6 Contributing
8.7 Manifesto
Django needs a mature wiki system appealing to all kinds of needs, both big and small:
• Be pluggable and light-weight. Don’t integrate optional features in the core.
• Be open. Make an extension API that allows the ecology of the wiki to grow in a structured way. Wikipedia
consists of over 1100 extension projects written for MediaWiki. We should learn from this.
• Be smart. This is the map of tables in MediaWiki - we’ll understand the choices of other wiki projects and
make our own. After-all, this is a Django project.
• Be simple. The source code should almost explain itself.
• Be structured. Markdown is a simple syntax for readability. Features should be implemented either through
easy coding patterns in the content field, but rather stored in a structured way (in the database) and managed
through a friendly interface. This gives control back to the website developer, and makes knowledge more
usable. Just ask: Why has Wikipedia never changed? Answer: Because it’s knowledge is stored in a complicated
way, thus it becomes very static.
8.8 Docs
34 Chapter 8. django-wiki
django-wiki Documentation, Release 0.3.1
If you wish to add something, please ask in the google group or raise an issue if you’re in doubt about whether
something might change.
8.9 Background
Django-wiki is a rewrite of django-simplewiki, a project from 2009 that aimed to be a base system for a wiki. It
proposed that the user should customize the wiki by overwriting templates, but soon learned that the only customization
that really took place was that people forked the entire project. We don’t want that for django-wiki, we want it to be
modular and extendable.
As of now, Django has existed for too long without a proper wiki application. The dream of django-wiki is to become
a contestant alongside Mediawiki, so that Django developers can stick to the Django platform even when facing tough
challenges such as implementing a wiki.
8.10 Q&A
• Why is the module named just wiki ? Because when we tried pip install wiki, it returned “No
distributions at all found for wiki”, so we had to make up for that!
• What markup language will you use? Markdown. The markup renderer is not a pluggable part but has been
internalized into core parts. Discussion should go here: https://github.com/django-wiki/django-wiki/issues/76
• Why not use django-reversion? It’s a great project, but if the wiki has to grow ambitious, someone will have
to optimize its behavior, and using a third-party application for something as crucial as the revision system is a
no-go in this regard.
• Any support for multiple wikis? Yes, in an sense you can just imagine that you always have multiple wikis,
because you always have hierarchies and full control of their permissions. See this discussion: https://github.
com/django-wiki/django-wiki/issues/63
8.11 Requirements
Please refer to current release to see exact version dependencies. And make note that Pillow needs to have certain
build dependencies satisfied on your host system.
• Django
• Markdown
• django-mptt
• django-sekizai
• sorl-thumbnail
• Pillow (Python Imaging Library)
• Python>=2.7 or Python>=3.4
8.12 Acknowledgements
• The people at edX & MIT for finding and supporting the project both financially and with ideas.
8.9. Background 35
django-wiki Documentation, Release 0.3.1
• django-cms for venturing where no django app has gone before in terms of well-planned features and high
standards. It’s a very big inspiration.
• django-mptt, a wonderful utility for inexpensively using tree structures in Django with a relational database
backend.
• spookylukey, jluttine, duvholt, valberg, jdcaballerov, yekibud, bridger, TomLottermann, crazyzubr, and every-
one else involved!
36 Chapter 8. django-wiki
CHAPTER 9
• genindex
• modindex
• search
37
django-wiki Documentation, Release 0.3.1
w
wiki.conf.settings, 19
wiki.plugins.attachments.settings, 21
wiki.plugins.images.settings, 22
wiki.plugins.links.settings, 22
wiki.plugins.macros.settings, 23
39
django-wiki Documentation, Release 0.3.1
A wiki.plugins.attachments.settings), 21
ACCOUNT_HANDLING (in module wiki.conf.settings),
19 G
ACCOUNT_SIGNUP_ALLOWED (in module GROUP_MODEL (in module wiki.conf.settings), 20
wiki.conf.settings), 19
ANONYMOUS (in module wiki.conf.settings), 19 I
ANONYMOUS (in module IMAGE_PATH (in module wiki.plugins.images.settings),
wiki.plugins.attachments.settings), 21 22
ANONYMOUS (in module IMAGE_PATH_OBSCURIFY (in module
wiki.plugins.images.settings), 22 wiki.plugins.images.settings), 22
ANONYMOUS_CREATE (in module
wiki.conf.settings), 19 L
ANONYMOUS_UPLOAD (in module LOG_IPS_ANONYMOUS (in module
wiki.conf.settings), 19 wiki.conf.settings), 20
ANONYMOUS_WRITE (in module wiki.conf.settings), LOG_IPS_USERS (in module wiki.conf.settings), 20
19 LOOKUP_LEVEL (in module
APPEND_EXTENSION (in module wiki.plugins.links.settings), 22
wiki.plugins.attachments.settings), 21 LOST_AND_FOUND_SLUG (in module
wiki.conf.settings), 20
C
CACHE_TIMEOUT (in module wiki.conf.settings), 19 M
CAN_ADMIN (in module wiki.conf.settings), 19 MARKDOWN_HTML_ATTRIBUTES (in module
CAN_ASSIGN (in module wiki.conf.settings), 19 wiki.conf.settings), 20
CAN_ASSIGN_OWNER (in module wiki.conf.settings), MARKDOWN_HTML_STYLES (in module
19 wiki.conf.settings), 20
CAN_CHANGE_PERMISSIONS (in module MARKDOWN_HTML_WHITELIST (in module
wiki.conf.settings), 20 wiki.conf.settings), 20
CAN_DELETE (in module wiki.conf.settings), 20 MARKDOWN_KWARGS (in module
CAN_MODERATE (in module wiki.conf.settings), 20 wiki.conf.settings), 20
CAN_READ (in module wiki.conf.settings), 20 MARKDOWN_SANITIZE_HTML (in module
CAN_WRITE (in module wiki.conf.settings), 20 wiki.conf.settings), 20
CHECK_SLUG_URL_AVAILABLE (in module MESSAGE_TAG_CSS_CLASS (in module
wiki.conf.settings), 20 wiki.conf.settings), 21
METHODS (in module wiki.plugins.macros.settings), 23
E
EDITOR (in module wiki.conf.settings), 20 R
REVISIONS_MINUTES_LOOKBACK (in module
F wiki.conf.settings), 21
FILE_EXTENSIONS (in module
41
django-wiki Documentation, Release 0.3.1
S
SEARCH_VIEW (in module wiki.conf.settings), 21
SHOW_MAX_CHILDREN (in module
wiki.conf.settings), 21
STORAGE_BACKEND (in module wiki.conf.settings),
21
STORAGE_BACKEND (in module
wiki.plugins.attachments.settings), 22
STORAGE_BACKEND (in module
wiki.plugins.images.settings), 22
T
THUMBNAIL_SIZES (in module
wiki.plugins.images.settings), 22
U
UPLOAD_PATH (in module
wiki.plugins.attachments.settings), 22
UPLOAD_PATH_OBSCURIFY (in module
wiki.plugins.attachments.settings), 22
URL_CASE_SENSITIVE (in module wiki.conf.settings),
21
URL_CONFIG_CLASS (in module wiki.conf.settings),
21
USE_BOOTSTRAP_SELECT_WIDGET (in module
wiki.conf.settings), 21
USE_LOCAL_PATH (in module
wiki.plugins.attachments.settings), 22
USE_SENDFILE (in module wiki.conf.settings), 21
W
wiki.conf.settings (module), 19
wiki.plugins.attachments.settings (module), 21
wiki.plugins.images.settings (module), 22
wiki.plugins.links.settings (module), 22
wiki.plugins.macros.settings (module), 23
42 Index