Error installing Booktype at syncdb
  • Hi,

    am installing on debian wheezy 64bit and intend to try Booktype locally at home.  I have been following the instructions in "Booktype 1.6. for Authors and Publishers", ch. "Installation on GNU/Linux".

    Django 1.6 is installed, but when i go on to run syncdb --noinput , it says :

    django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

    Don't know how or where to fix this problem. Grateful for your advice.




  • 10 Comments sorted by
  • Hi Mikael,

    have you loaded booki.env file which has define paths and DJANGO_SETTINGS_MODULE?

  • Hi again,

    before doing " syncdb --noinput", I did

    $ . ./booki.env 

    and it was accepted.

    booki.env has these lines:

    "export PYTHONPATH PATH"
    "export DJANGO_SETTINGS_MODULE=mybooktype.settings"

    Is mybooktype.settings a file? If so, I cannot find it.


  • Hi Mikael,

    in your case settings is in /var/www/mybooktype/ file.

    Could you please post what version of Django and Python you are using:

       python -c "import django; print django.get_version()"
       python --version



  • Here:

    root@debian:/var/www/mybooktype#  python -c "import django; print django.get_version()"
    root@debian:/var/www/mybooktype# python --version
    Python 2.7.3

  • Newer version of Django could be a problem. Booktype 1.6.1 works with Django 1.3/1.4. Dependencies and specific version are listed in requirements/_base.txt file. If you need Django 1.6 for other reasons you should install Booktype inside of virtualenv with specified requirements.

  • Thank you. I did pip uninstall django, and successfully installed django-503 (which is said to be Django 1.3).

    I then tried to run  ./createbooki --check-versions --database postgresql /var/www/mybooktype/ again.
    But this resulted in:
    + Trying to import Django.   [ERROR]

  • This check only does "import django". It fails so I would say installed Django is for some reasons not in the path.

  • Hi. In order to put Django into the path, I need to find out the path to Django. The find command found this:
     usr/local/lib/python2.7/dist-packages/django_503 -- should /usr/local be in the path ?
  • Hi Mikael!

    This package you installed, django_503, is it by any change this because it seems to be Django app and not Django itself. If it is, just install older version of Django and try again. It should be in the path after you install it with pip:
      pip install Django==1.3

  • Thank you for your help Aleksandar, Booktype is now up and running.