SocialBooks Installation Guide
- Django svn-trunk release (current: svn-r13444)
- Python 2.5 or 2.6 (virtualenv recommended)
- MySQL or other supported database (should be able to override in local.py)
- Via pip (or easy_install):
- python-openid (2.x)
- lxml // Using from Ubuntu repos
- Via Ubuntu Repos:
Running setup.py install will install these packages for you. NOTE: setup.py not available as of now. Manually install above packages with pip
Google up the source tarballs for the below packages, and place it into src/ in your project directory. Create src/ if not present. Find the proper source directory (ie. the one with __init__.py) of each download package, and symlink that into the project directory.
- gdata //using from easy_install
- Remember to perform the following to initialise the submodules added to this project
- git submodule init
- git submodule update
- Current submodules:
- isbndbpy - http://github.com/ruiwen/isbndbpy
Setup Django South migrations
./manage.py schemamigration library —initial repeat for library, api, mobile, all apps that have models.py
after you've done that repeat with ./manage.py migrate <appname>
The first time you get here, manually create the database and user permissions according to values in ./settings.py
create database bookworm default character set = UTF8; //wrong statement. Create using phpmyadmin with charset = utf8 and collation = utf8_general
To set local settings, please write the modified values from settings.py in local.py, do not change settings.py. local.py overwrites the default settings.
Then, from the project root:
python manage.py syncdb //No need to sync superuser creds python manage.py test library --settings=test_settings # Sanity check //test settings not yet ported from bookworm
You should only need to run syncdb initially, or when the schema changes.
You will need to create this manually after setting up the database:
mysql> create fulltext index epubtext on library_htmlfile (words);
By default, Bookworm expects to be able to write to its log directory $PROJECT_ROOT/log and to the storage directory $PROJECT_ROOT/library/storage. You will need to ensure that the web server has write access there.
There is one required cron job, which updates the indexes and also cleans up book metadata:
You can run this at whatever frequency you prefer; I do it on the half-hour.
To test the models and views: python manage.py test library --settings=test_settings
To test the mobile version: python manage.py test mobile --settings=test_settings_mobile
To test the API: python manage.py test api
To run a local development server: python manage.py runserver
To start over with a clean database: clear-db.sh
clear-db takes optional arguments:
- no arguments clears only the 'library' app
- 'auth' clears the base Django auth framework
- 'openid' clears the django_authopenid database
- 'all' clears all of the above
Other documentation is in docs/