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 django-admin.py syncdb --noinput , it says :

    <pre>
    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.
    </pre>

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

    Mikael
    Mikael

     


    W

  • 10 Comments sorted by
  • Hi Mikael,

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

    Aco
  • Hi again,

    before doing "django-admin.py syncdb --noinput", I did

    $ . ./booki.env 

    and it was accepted.

    booki.env has these lines:

    "PYTHONPATH=$PYTHONPATH:/var/www/:/var/www/mybooktype/lib/:/usr/local/src/Booktype/lib"
    "export PYTHONPATH PATH"
    "export DJANGO_SETTINGS_MODULE=mybooktype.settings"

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

    Mikael


  • Hi Mikael,

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

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

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

    Thanks!

    Aco

  • Here:

    root@debian:/var/www/mybooktype#  python -c "import django; print django.get_version()"
    1.6
    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.

    Aco
  • 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.

    Aco
  • 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 https://pypi.python.org/pypi/django-503? 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

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