Theju's tryst with life

A wiki with a couchdb backend and django

Recently, 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.

Yet another redesign at thejaswi.info

Oh yes!!! You are seeing it right! There's been another redesign of my site.

Technology fascinates me and I cannot get enough of it. This time I wanted my blog powered by the latest and coolest technology. Want to know more?

CouchDB powers the heart of the blogging engine as opposed to an RDBMS. CouchDB-python talks to the DB and the web app. How on earth could I have left my favourite framework out of this cool stuff! I make use of the Django templates and views for the presentation and logic.

CouchDB stores the posts, comments, authentication related data and session data. I have written custom auth and session backends in Django that store the data on the DB. The source has been released and is available here.

The advantages of using couchDB:

  • It scales tremendously. Suppose my blog readership touches a few million, all I would need to do is to add more couchDB nodes and voila it scales!!!
  • Since couchDB uses HTTP as the underlying protocol, it can be cached very easily using standard cache utilities like Squid and Varnish.
  • It is schema-less. I could easily add/edit and remove fields from the DB without having to get frightened about it's integrity.

The disadvantages of using couchDB:

  • couchDB is growing fast and still does not have a few features (slated to be released soon) and the API is a moving target.
  • It can give you a few scares from time to time. I almost lost my data when I made a few cfg changes. After googling around, I figured out that the data was safe but couchDB would require a reinstall.

Hope this time, the technology powering my blog is not obsoleted so fast ;-).

PS1: If you have come to the site from a previous bookmark, please update your bookmarks. I am sorry about breaking your results.

PS2: Some services on my blog are still missing, I promise to have them up at the earliest.

PS3: I am in the process of releasing the source code of the site. If you are one of the impatient folks, please ping me.

The number of posts are 2. The number of pages are 1.