some basic docs
[wolnelektury.git] / doc / installation.rst
1 =====
2 Setup
3 =====
4
5 Requirements
6 ------------
7
8 * `Python 2.6+ <http://python.org>`_
9 * Everyting from the ``requirements.txt`` file
10 * a library for your database of choice
11  (see `DBs supported by Django <http://docs.djangoproject.com/en/dev/topics/install/#get-your-database-running>`_)
12 * `puLucene <https://github.com/fnp/pylucene/>`_ for search
13 * Librarian dependencies, see lib/librarian/README.md
14
15
16 Installation
17 ------------
18 Installing database::
19
20     cd wolnelektury
21     ./manage.py syncdb
22     ./manage.py migrate
23
24
25 Running
26 -------
27
28 You can run the server with::
29
30     ./manage.py runserver
31
32 If you want to run lengthy tasks (like generating e-book files) in a seperate
33 Celery process (this is the default), you'll also need to run:
34
35     ./manage.py celeryd --loglevel=INFO
36
37 If you don't want to run a separate Celery daemon, make sure you set this
38 option in your ``localsettings.py``::
39
40     CELERY_ALWAYS_EAGER = True
41
42
43 Deployment
44 ----------
45 Setup your server in fabfile.py and do::
46
47     fab <your_server_name> setup
48
49 Aside from uploading a current (git's HEAD) version of the app this will also
50 download all dependencies into a `virtualenv <http://www.virtualenv.org>`_, 
51 create a VHost and WSGI files for running with Apache and mod_wsgi, and
52 a celery config file for `supervisord <http://supervisord.org/>`_.
53
54 To deploy a new version into an existing setup, do:
55
56     fab <your_server_name> deploy
57
58 This will also check for new dependencied, migrate your app and restart the
59 WSGI server and Celery under supervisord.