README

What is it?

NikiWiki is a simple wiki written in Python with markdown. It is designed to be simple to use and easy to modify to suit my needs (though it may be useful for you too).

Usage

Editing pages is as simple as clicking on the page name in the top right corner, or on any header element within the page. Once you are done editing, click save to POST the content back to the server.

Content authoring is done using the markdown syntax allowing you to create nice looking HTML pages without the redundancy of writing a bunch of HTML by hand.

Requirements

Installation

Open niki.py in your favorite editor and change INSTALL_DIR to point to the directory with the nikiwiki installation inside. You may also edit the contents of the vars dict to customize various aspects of the page template.

Save the niki.py file and run python niki.py to start the server for debugging. At this point, you should be able to access the wiki at http://localhost:8080/. For further customization of the web server and more production-like configuration, read the web.py documentation

Example FastCGI/nginx configuration

Place the following in your nginx configuration

location / {
       fastcgi_pass    127.0.0.1:9999;
       fastcgi_param   PATH_INFO    $fastcgi_script_name;
       fastcgi_param   REQUEST_METHOD  $request_method;
       fastcgi_param   QUERY_STRING    $query_string;
       fastcgi_param   CONTENT_TYPE    $content_type;
       fastcgi_param   CONTENT_LENGTH  $content_length;
       fastcgi_param   SERVER_ADDR  $server_addr;
       fastcgi_param   SERVER_PORT  $server_port;
       fastcgi_param   SERVER_NAME  $server_name;
       fastcgi_param   SERVER_PROTOCOL $server_protocol;
       fastcgi_pass_header Authorization;
       fastcgi_intercept_errors off;
   }
   location /static {
       root /path/to/nikiwiki/static;
   }

Start the nikiwiki server python niki.py

Assuming the rest of your nginx configuration is correct, you should be able to access the wiki through nginx. At this point, adding things like authentication and logging are trivial. See the nginx documentation for details.

Internals

NikiWiki is a RESTful application in that you can perform the usual view, create, update, and delete actions through standard HTTP methods. The implemented methods are as follows:

A few quick notes on the implementation details:

Caveats

This code is largely imperfect and was written hastily with little attention to things like security and stability. If you intend to deploy NikiWiki to a public web server, you are putting your server at risk. You have been warned.

or