Command Line
This is some brief information on how to use the command line admin tools for Booktype. Using these tools you can export and import books and change the URLS and titles of books.
You can do a lot of damage with this, so be careful.
Tools
django-admin.py help brokenlinks
django-admin.py help bookimport
django-admin.py help bookexport
django-admin.py help bookrename
brokenlinks
brokenlinks - check links inside of book(s).
django-admin.py brokenlinks command-line my-book
django-admin.py brokenlinks --no-remote command_line
django-admin.py brokenlinks --ignore-url http://www.wikipedia.org/ command_line
bookexport
bookexport - exports book into booki-zip file. this is not real export, and it does not export historic data.
django-admin.py bookexport command-line
django-admin.py bookexport --output my-export.zip --book-version 2.2 command-line
bookimport
bookimport - imports new book from booki-zip file. you can import it
under new name also.
django-admin.py bookimport book.zip
django-admin.py bookimport --owner aerkalov book.zip
django-admin.py bookimport --new-book-title "New title for Command
line" book.zip
django-admin.py bookimport --new-book-title "New title for Command
line" --new-book-url commandline book.zip
bookrename
bookrename - renames existing book.
django-admin.py bookrename --new-book-title "New title" command-line
django-admin.py bookrename --new-book-title "New title" --new-book-url commandline command-line
django-admin.py bookrename --owner aerkalov command-line
notes
- there is env.sh script in the root. you should read that with "./env.sh" before doing any work from the command line, and especially if trying to run any django management command. you should set it up (it sets pythonpath, path and some other things). when running django app, all this things are loaded trough wsgi script, but when using command line you should load it manually (or put it in your profile, and have it loaded every time. but this is not very smart). this is also place where you setup your DJANGO_SETTINGS_MODULE environment variable.
- never run anything as root, or god forbid as your user account (or have things installed in your personal /home directory). if booktype is installed to be run as www-data user through apache, then everything must be run as that user. if you use root account, it will work, but it will also screw file permissions on your log files, on your attachment files and etc. also, running things with super user privilege is not very smart. if you go to booktype directory and you see more then one user in "ls -l" result list, you are doing it wrong.
- 3. django-admin.py and manage.py is result of not having defined DJANGO_SETTINGS_MODULE variable (and not having django/bin in your path). if you know what you are doing and what manage.py file you are running, it is ok to use it, but it is much smarter to be 100% sure with DJANGO_SETTINGS_MODULE and django-admin.py. if you have more then 2 installations on the same machine, DJANGO_SETTINGS_MODULE is sane way to work with them. and etc..etc...etc...





