Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

256 lines (160 sloc) 7.629 kB
Installing Booktype 1.5
Note : there are three components to the Booktype Tool Set. This doc
covers only the Booktype (editor/book manager) component and not Espri
(importer) or Objavi (exporter). By default Booktype is hardwired to the
FLOSS Manuals install of Objavi and Espri so you still acquire that
functionality. To detach yourself from the FLOSS Manuals mothership
you need to install Espri and Objavi and configure your install of
Booki accordingly.
This document describes how to install the latest stable versions of
Django, simplejson, and Redis, using python's easy_install. If you
have a sufficiently recent distribution (e.g., Debian Squeeze), you
can just use the distro versions. In that case, skip the easy_install
steps and do whatever is appropriate with your package manager.
Booktype prerequisites
Command examples are for Debian/Ubuntu. Depending of your OS you might
need to install some of the python packages using easy_install
( or pip (
Please check how to install them on your OS if they are not present.
- Python, minimum 2.5 ( and headers
$ sudo apt-get install python-dev
- PostgreSQL (recommended) or Sqlite3 (not recommended)
$ sudo apt-get install postgresql
$ sudo apt-get install sqlite3
- Psycopg (must use this adapter with PostgreSQL)
$ sudo apt-get install python-psycopg2
- git repository manager (
$ sudo apt-get install git-core
- Python Set Up Tools and pip (
$ sudo apt-get install python-setuptools python-pip
- Django, minimum 1.2 (http://
$ sudo easy_install django
$ sudo apt-get install python-django
- SimpleJSON
$ sudo easy_install simplejson
- Redis (
$ sudo apt-get install redis-server
- South (
$ sudo easy_install South
- lxml (
$ sudo apt-get install libxml2-dev and libxslt-dev
$ sudo easy_install lxml
- Unidecode (
$ sudo pip install unidecode
Installing from the git repository
This install doc uses sqlite3 (it is recommended to use PostgreSQL) as its the
easiest to setup so make sure sqlite3 is installed. Do all of the steps as regular
user or www-data user.
More information about Booktype deployment can be found in doc/deployment/ directory.
1. Clone Booktype
git clone
2. Change dir to 'Booktype/scripts'
cd Booktype/scripts
3. Create booktype instance. If you have write permissions, script will create directory /var/www/mybooktype/. If you don't
have write permissions, administrator should create that directory first.
sudo mkdir /var/www/mybooktype/
sudo chown www-data:www-data /var/www/mybooktype/
./createbooki --database sqlite /var/www/mybooktype/
You can also let create script check if you have installed all needed libraries:
./createbooki --check-versions --database sqlite /var/www/mybooktype/
4. Change directory
cd /var/www/mybooktype/
5. Edit settings
6. Load environment variables
. ./booki.env
7. Initialize database syncdb --noinput
8. Migrate migrate
9. Create superuser account createsuperuser
10. Add common dokumentation licenses loaddata documentation_licenses
11. Start redis (If you are using the distro's Redis server, this may
not be necessary or desirable).
redis-server &
12. Start the whole thing runserver
Then if all is well open your browser and point to something like:
How to use Booktype with Apache and mod_wsgi
To install Booktype with Apache, you need to use WSGI or FCGI/SCGI. Consult the
Django documentation at
Createbooki script has created booki.wsgi script for the Apache. Use that
file as part of your Apache config.
How to migrate to latest Booki 1.4
1. The following should be added to
# export credentials that override Objavi settings
2. Templates have been changed. If you have modified template "editor/edit_book.html" you will
have to modify it again. Please be careful about this part of template:
<ul class="bookStatuses template">
{% for s0, s1 in statuses %}
<li id="{{s0}}">{% trans s1 %}</li>
{% endfor %}
Some part of template have been separated into:
How to migrate to Booki 1.2
1. There are new template files. Be aware if you have changed template files.
reader/book_info.html (new file)
reader/book_view.html (used to be reader/book.html)
reader/book_chapter.html (used to be reader/chapter.html)
reader/draft_book.html (used to be reader/book.html)
reader/draft_chapter.html (used to be reader/chapter.html)
2. There are new named URL patterns.
book_view (used to be view_book, does not have book version argument anymore)
book_chapter (used to be view_chapter, does not have book version argument anymore)
book_info (new)
draft_book (used to be view_book)
draft_chapter (used to be view_chapter)
For instance. If you had in your template:
{% url view_chapter book.url_title book_version chap.url_title %}
Now you must use this syntax (notice there is no book version argument):
{% url book_chapter book.url_title chap.url_title %}
3. You must add new default template directory to file. This is how TEMPLATE_DIR should look like:
'%s/templates/' % BOOKI_ROOT,
'%s/templates/' % os.path.dirname(booki.__file__)
4. Read lib/booki/messaging/README.txt how to install new Messaging app.
How to migrate to Booki 1.1
1. Install Booki again with 'createbooki' script
2. Change configuration in new file (compare it with old configuration)
3. Change attachment path in database. Please change OLD_PATH and NEW_PATH to point to new directories. If you don't do this, attachments will not be accessable.
$ django-admin shell
>>> from booki.editor import models
>>> OLD_PATH = '/Users/aerkalov/Work/git/booki/site_media/static/'
>>> NEW_PATH = '/Users/aerkalov/Work/git/mybooki/data/books/'
>>> for att in models.Attachment.objects.all():
... print '>> ',
... name =, NEW_PATH)
... = name
>>> from django.contrib.auth.models import User
>>> OLD_PATH = '/Users/aerkalov/Work/git/booki/site_media/static/_profile_images/'
>>> NEW_PATH = '/Users/aerkalov/Work/git/mybooki/data/profile_images/'
>>> for u in User.objects.all():
... p = u.get_profile()
... print '>>> ',
... name =, NEW_PATH)
... = name
Jump to Line
Something went wrong with that request. Please try again.