A wiki with a couchdb backend and django
Fri 28 August 2009 by Thejaswi PuthrayaRecently, I had a requirement for a personal simple wiki. I checked out various options like TiddlyWiki, MoinMoin and MediaWiki but wanted something very simple and something that didn't use a database server or flat files and was portable (and hostable). So I quickly wrote up a wiki that used couchdb as its backend and django for the web app.
Couchdb stores the revisions of the edits and so I could always revert to a previous version if required. It also saved me the need of installing an RDBMS.
I released the code for the app at github. It's quite rudimentary at the stage but should be good enough for personal use. Hopefully, with a little more time and effort, I should be able to achieve what I set out for. (Check a demo). Just create a page of your choice by directing your browser to it.
Note: User registration is blocked at the moment. But feel free to edit and create pages anonymously.
Interested in trying out the code on your machine?
INSTALL
- Fetch the auth and sessions backends for couchdb from here and add them to the INSTALLED_APPS in your project's settings.py as per the instructions. Also requires couchdb-python.
- Place the wiki app and reference it too in the INSTALLED_APPS.
- Append the wiki/templates directory (with the absolute path) in the TEMPLATE_DIRS attribute of the settings.py.
- Add a pointer to the wiki URL and account urls in your urls.py like
(r'^wiki/', include('wiki.urls')) (r'^accounts/', include('django.contrib.auth.urls'))
Add the following attributes to your settings.py.
COUCHDB_HOST = 'http://path_to_couchdb_server:port_num/' # If you don't want unauthenticated users to create # pages, then set the below attribute to False ALLOW_UNAUTH_PAGE_CREATION = True # The below attribute is optional, if not specified # it redirects to an empty page. WELCOME_PAGE = '/path/to/default/star/up/page/'
Your wiki is ready!
Please let me know how you feel about this app.