Rename book gives "django-admin.py: command not found"
  • In the automated install on Ubuntu 14.04 I try to rename a book according to instructions here: http://sourcefabric.booktype.pro/booktype-20-for-authors-and-publishers/command-line-admin/

    cd /var/www/booktype/instance1/
    sudo su www-data
    . ./booktype.env

    django-admin.py bookrename --new-book-title="My new book" <My old book>

    The result of this command is:

    django-admin.py: command not found

    Also, should I enclose the old bookname in double quotes like this "My old book"?

  • 8 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Graabein,

    If Django was installed correctly, you should have a file such as:

    /usr/local/lib/python2.7/dist-packages/django/bin/django-admin.py

    and also:

    /usr/local/bin/django-admin.py

    If not, using ./manage.py in place of django-admin.py will work the same, if you are in the instance directory where manage.py is found.

    According to the docs, the syntax is:

    django-admin.py bookrename --new-book-title="My new title" "My old title"

    If the book title contains spaces, you would always need quotes around it on the command line.

    Cheers!

    Daniel




  • Thank you Daniel

    What is the syntax if there is a double quote in the bookname(itself) itself, like:

    "This old booktitle has "double quotes" in the name"

    manage.py bookrename --new-book-title="My new title" "This old booktitle has "double quotes" in the name"
  • I installed the booktype automated install on a fresh DigitalOcean Ubuntu 14.04 droplet.  I assumed this automated install also installed all the dependencies it needed, but something might have gone wrong it seems.

    Looking in /usr/local/lib/python2.7/dist-packages/
    there is no /django/bin/django-admin.py

    /usr/local/bin/ is also empty, no django-admin.py in there

    I then try your advice, using manage.py instead

    # cd /var/www/booktype/instance1/
    # su www-data
    $ . ./booktype.env (I expected something indicating that some virtual environment is loaded, but nothing happens)
    Then I do:
    $ manage.py bookrename --new-book-title="My new title" "This old booktitle has "double quotes" in the name"
    manage.py: command not found

    I am inside /var/www/booktype/instance1/ and the file manage.py is definately there.



    Post edited by Graabein at 2016-05-04 05:38:03
  • Sorry, I forgot the DOT/ in front of manage.py, so the command should be

    ./manage.py bookrename --new-book-title="My new title" "This old booktitle has "double quotes" in the name"

    this resulted in

    Traceback (most recent call last):
      File "./manage.py", line 5, in <module>
        from unipath import Path
    ImportError: No module named unipath
    www-data@xxxxxxx:~/booktype/instance1$

  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Graabein,

    Perhaps you have some Python packages installed globally, as well as inside a virtualenv. Please see http://stackoverflow.com/questions/14659855/django-settings-could-not-import-unipath

    Cheers!

    Daniel
  • Maybe, but all I have done is this:

    1. Created a fresh Digital Ocean Ubuntu 14.04 droplet
    2. Installed the automated installation of booktype 2
    3. Installed Postfix as a send only mail server.

    So, maybe there is some misconfiguration (or missing stuff) in your automated install package, that don't give the user all the tools needed to manage the installation?  I understand it is not your obligation to do so, but maybe then the install guide could be updated to include the extra steps one need in order to have all the tools working as they are supposed to?
  • Any idea when Booktype 2.1 will be released as a automated install package so I can update the installation with the new fixes and modifications?

    I ask, as I now have an 2.0 automated installation where I am not able to publish any books because of the template problem which is described here and which instructions how to fix is still unclear to me: https://forum.sourcefabric.org/discussion/17895/cover-image-prints-twice

    Also, due to the problems described in THIS thread, with link to a stackoverflow discussion thread I don't understand, I am not able to export (backup) books already created in order to import them in another installation.

    Also I have users starting to work on current installation, and thus doing a completely new installation using git (as you suggest here https://forum.sourcefabric.org/discussion/17895/cover-image-prints-twice) will be problematic.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Graabein,

    The easiest method to export a book for backup purposes is to use the export to EPUB feature on the Publish tab of the editor. This EPUB can be imported into another Booktype instance and renamed if required.

    If you want an up to date Booktype instance without having to maintain it yourself, I would suggest using our free Omnibook platform: https://omnibook.pro/

    Cheers!

    Daniel