new be issue... cant install booktype...
  • Hi

    I am installing booktype on ubuntu 12.04.

    It seemed to install ok, but when I load the page I get a 500 error.

    Inspecting nano /var/log/apache2/booktype-error.log, I see:

    [Mon Nov 18 06:56:20 2013] [error] [client] mod_wsgi (pid=9486): Target WSGI script '/var/www/' cannot be loaded as Python module.
    [Mon Nov 18 06:56:20 2013] [error] [client] mod_wsgi (pid=9486): Exception occurred processing WSGI script '/var/www/'.
    [Mon Nov 18 06:56:20 2013] [error] [client] Traceback (most recent call last):
    [Mon Nov 18 06:56:20 2013] [error] [client]   File "/var/www/", line 15, in <module>
    [Mon Nov 18 06:56:20 2013] [error] [client]     import django.core.handlers.wsgi
    [Mon Nov 18 06:56:20 2013] [error] [client] ImportError: No module named django.core.handlers.wsgi

    I am sure it is something "basic", but I am a newbe in terms of linux, ubuntu and python!

    Can you please give me some pointers on

    a. how I can debug this

    b. what I can do to fix this?

    Thank you

  • 5 Comments sorted by
  • Do you have django installed?
  • make sure you install booktype in the virtual environment with django as written in the install instructions. this should solve your issue.
  • Thank you for your answers. 

    django is installed I think because I can type django-admin without an error. 

    Kararadski: I am not sure how to do this!  How do I install it in a virtual environment?  I am pretty sure that I followed the installation instructions reasonably well.

    Here are some further notes...

    Here is some information I found: 

    relevant links:

    Check out the settings in two files below:


    import os, sys

    #Calculate the path based on the location of the WSGI script.
    #apache_configuration= os.path.dirname(__file__)
    #project = os.path.dirname(apache_configuration)
    #workspace = os.path.dirname(project)

    #Add the path to 3rd party django application and to django itself.
    sys.path.insert(0, '/var/www/')
    sys.path.insert(1, '/var/www/')
    sys.path.insert(2, '/var/www/')

    os.environ['DJANGO_SETTINGS_MODULE'] = 'mybook.settings'
    import django.core.handlers.wsgi
    application = django.core.handlers.wsgi.WSGIHandler()


    # Apache configuration for Booktype server V1.0.1

    <VirtualHost *:80>

         # CHANGE THIS
         SetEnv HTTP_HOST ""

         SetEnv LC_TIME "en_GB.UTF-8"
         SetEnv LANG "en_GB.UTF-8"

         WSGIScriptAlias / /var/www/

         <Location "/">
           Allow from all
           Options FollowSymLinks

         Alias /static/ "/var/www/"
         <Directory "/var/www/">
           Order allow,deny
           Options Indexes
           Allow from all
           IndexOptions FancyIndexing

         Alias /site_static/ "/var/www/"
         <Directory "/var/www/">
           Order allow,deny
           Options Indexes
           Options FollowSymLinks
           Allow from all
           IndexOptions FancyIndexing

         Alias /media/ "/contrib/admin/media/"
         <Directory "/contrib/admin/media">
           Order allow,deny
           Options Indexes
           Options FollowSymLinks
           Allow from all
           IndexOptions FancyIndexing

         ErrorLog /var/log/apache2/booktype-error.log
         LogLevel warn
         CustomLog /var/log/apache2/booktype-access.log combined


    Do you know someone who I can pay to help me install it? This is for a major NGO and I would love to get it going for them. 
  • My platform is Ubuntu 12.04 and I am trying to intall the apache postgres route...
  • I helped Nicolaas but I am posting here info for other to see.

    I think he used script to install Booktype. It created virtualenv and installed all needed packages but did not modify wsgi script to activate the virtualenv.

    File booki.wsgi had to activate virtualenv and everything worked after that.

    activate_this = '__PATH_TO_VIRTUALENV_/bin/'
    execfile(activate_this, dict(__file__=activate_this))