how to set up a recent version of booktype
  • I followed the manual guide and set up a dev-environment but used a virtualenv for safety reasons. I dont have a full domain yet because I'm in the process of evaluating if Booktype fits all my needs. For some reason I'm unable to log in in my Booktype instance, despite the fact that I created a superuser with ./ createsuperuser.

    User does not exist.
    Password is wrong! Please try again.
    Your account is inactive! Please, contact site support.
    Unknown error!

    There are errors and I would be glad if you could give me some suggestions to solve my issues. This is how booktype looks like now.



    $ sudo apt-get install postgresql php5-cli php5-gd apache2-mpm-prefork libapache2-mod-wsgi git-core python-setuptools python-dev python-virtualenv libjpeg-dev libpq-dev libxml2-dev libxslt-dev rabbitmq-server redis-server tidy nano
    $ easy_install pip
    $ pip install virtualenv

    Setup postgres database

    $ su - postgres
    $ createuser -SDRP booktype-user
    $ createdb -E utf8 -T template0 -O booktype-user booktype-db
    $ exit
    $ sudo service postgresql restart

    Setup PDF renderer

    $ cd /tmp/
    $ sudo mkdir -p /var/www/
    $ wget
    $ sudo unzip -d /var/www/
    $ cd /var/www/mpdf60/
    $ sudo chown www-data.www-data examples/test.pdf graph_cache/ tmp/ ttfontdata/
    $ cd /var/www/mpdf60/examples/
    $ sudo sed -i 's;www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin;www-data:x:33:33:www-data:/var/www:/bin/bash;' /etc/passwd
    $ sudo su www-data
    $ for i in example*.php; do php $i > /tmp/$i.pdf; done

    Setup Booktype

    $ cd /usr/local/src/
    $ virtualenv --distribute mybooktype
    $ source mybooktype/bin/activate
    $ mkdir -p mybooktype/local/src/booktype
    $ sudo git clone --branch master --depth 1 $ mybooktype/local/src/booktype
    $ sudo pip install -r mybooktype/local/src/booktype/requirements/dev.txt
    $ sudo pip install -r mybooktype/local/src/booktype/requirements/prod.txt
    $ sudo pip install ebooklib
    $ sudo mkdir /var/www/booktype/
    $ sudo chown www-data:www-data /var/www/booktype/
    $ sudo chown -R www-data:www-data mybooktype/local/src/booktype/

    Log in with user www-data

    $ sudo su -s /bin/sh www-data 
    $ cd /usr/local/src/mybooktype/local/src/booktype/scripts/
    $ ./createbooktype -p dev --check-versions --database postgresql /var/www/booktype/instance1
    $ cd /var/www/booktype/instance1/
    $ nano instance1_site/settings/
    $ nano instance1_site/settings/
    $ . ./booktype.env
    $ ./ migrate
    $ ./ createsuperuser
    $ ./ runserver

    In another terminal

    $ cd /var/www/booktype/instance1/
    $ sudo su -s /bin/sh www-data
    $ ./ celery worker --concurrency=10 -l debug

    logiles & terminal output



    Post edited by tristank at 2017-01-25 10:42:06
  • 5 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi, this failure to load the interface is a common issue when using a domain that doesn't exist or a local IP address. If you do not have a real domain to use yet, I suggest setting up a fake one in /etc/hosts

    Please take a look at the source of the login page around line 18 and see where the link to CSS is pointing. For a prod (production) profile it should be something like:
    <link rel="stylesheet" href="/static/CACHE/css/a9ea424f1e42.css" type="text/css" />

    but for a dev profile the static files are not collected into a cache.

    If this link does not point to a real file, please let me know. Also I note that you say you are using the prod profile, but in the console output above you have edited settings/ so please check that you have enabled the correct profile in which case you would edit settinng/ for the instance.


  • Hi Daniel, thanks for looking into my issue. I'm sorry this was a oversight. I meant dev-environment. I'm not using a virtual machine, so I editing etc/hosts wont do it. I set up a temporary subdomain at and edited instance1_site/settings/ accordingly. Are there any other variables I'll have to change except THIS_BOOKTYPE_SERVER and BOOKTYPE_URL in What about THIS_BOOKTYPE_SERVER and BOOKTYPE_URL in

    This is how the source of the login page looks like, still broken.

    <link href='' rel='stylesheet' type='text/css' />
    <link href='' rel='stylesheet' type='text/css' />
    <link href='' rel='stylesheet' type='text/css' />
    <link href='' rel="stylesheet" />
    <link href='' rel='stylesheet' type='text/css' />
    <link href='' rel='stylesheet' type='text/css' />
    <link href='' rel='stylesheet' type='text/css' />

    Does this seem appropriate for a dev env? If I'm not mistaken the port-number is missing.

    Please have a look for yourself at
    Post edited by tristank at 2017-01-25 10:35:33
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi, I'll break this down into points :-)

    1. You can use /etc/hosts to point to any machine, whether virtual or not. This is useful if your subdomain does not exist in DNS, but in this case you don't need it any more.

    2. If you have set values in or you do not need to set the same values in also.

    3. Using the command
    is really just for testing. If you want your server to be available to the outside world, I suggest using a normal web server such as Apache on port 80. Please see 'Apache configuration' in replacing with in the examples of course.

    Let us know how you get on, you're nearly there!

  • It's up and running. But I'm getting frequent page errors and the book export isnt working. So far I'm impressed and it's only the tip of the iceberg. Kudos to you! I've several other question. Should I open other threads or keep the discussion here. 
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi, good to hear you got it working! I think a new thread for each type of error is a good idea, it helps others to find the solutions. I suggest we start with the page errors, please start a new thread with full details.