Installation
Note
The development team are always happy to hear suggestions for how to streamline this process.
Download
The preferred way to get hold of django-wikiwikiweb is via pip:
$ pip install django-wikiwikiweb
This may be a good time to add django-wikiwikiweb to your project’s requirements.txt.
The django-wikiwikiweb source code is also available via the project’s GitHub repository.
Initial Configuration
There are a few changes to make to your project’s configuration files.
App Settings
In your project’s settings.py:
add the app and its dependencies to
INSTALLED_APPS:INSTALLED_APPS = [ ... 'wikiwikiweb', 'markdownify', 'simple_history', 'django_bootstrap5', ]
enable the
django-simple-historymiddleware by adding the following entry toMIDDLEWARE:MIDDLEWARE = [ ... 'simple_history.middleware.HistoryRequestMiddleware', ]
enable the
django-wikiwikwebcontext processor by adding the following to entry toTEMPLATES:TEMPLATES = [ { ... 'OPTIONS': { 'context_processors': [ ... 'wikiwikiweb.context_processors.site_wide_context', ], }, }, ]
App URLs
In your project’s root urls.py:
include the
django-wikiwikiwebURL routes file in yoururlpatterns:urlpatterns = [ # To run under a path: path('wiki/', include('wikiwikiweb.urls')), ... # OR it will also run just fine as a standalone site: #path('', include('wikiwikiweb.urls')), ... # Don't forget Django's own routes for login/logout path('accounts/', include('django.contrib.auth.urls')), ]
Database Migrations
finally, apply the database migrations to create the tables needed by
django-wikiwikiweb:
$ python manage.py migrate wikiwikiweb
You should now be good to go. Upon starting the Django server, you should now have an empty Wiki under /wiki/, or wherever you chose for it to live. A WikiWikiWeb section should now be available under the Django admin site. Visit the Admin Quickstart guide for Wiki admins to get started.
Optional Settings
There are a small number of optional settings to consider:
django-wikiwikiwebintegrates with the Django auth system (i.e. user management and authentication) to some extent, in that it uses login and logout links which reference the auth URLs. Thus, if you don’t already, you may wish to add definitions for the constantsLOGIN_REDIRECT_URLandLOGOUT_REDIRECT_URLinsettings.py.django-wikiwikiwebusesdjango-markdownifyto format pages (see Markdown). You may wish to allow more (or fewer) HTML tags to be generated thandjango-markdownifyallows by default. This is done via theMARKDOWNIFYconstant insettings.py. The settings allowed bydjango-markdownifyare very well documented on the project’s own documentation site: https://django-markdownify.readthedocs.io/en/latest/settings.html