X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/2c968d7bbf97b820439c6a997de08cc3411abb07..111104c8e3e9487965eac9e916200a12d43bf2be:/doc/installation.rst?ds=sidebyside diff --git a/doc/installation.rst b/doc/installation.rst index da0a9a83c..3b16bbb32 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -5,37 +5,34 @@ Setup Requirements ------------ -* `Python 2.6+ <http://python.org>`_ -* Everyting from the ``requirements.txt`` file +* `Python 2.7 <http://python.org>`_ +* Python requiremets: ``pip install -r requirements.txt`` * a library for your database of choice - (see `DBs supported by Django <http://docs.djangoproject.com/en/dev/topics/install/#get-your-database-running>`_) -* `puLucene <https://github.com/fnp/pylucene/>`_ for search -* Librarian dependencies, see lib/librarian/README.md - - -Installation ------------- -Installing database:: - - cd wolnelektury - ./manage.py syncdb - ./manage.py migrate + (see `DBs supported by Django <http://docs.djangoproject.com/en/dev/topics/install/#get-your-database-running>`_) +* `Sass <http://sass-lang.com>`_ >= 3.2 for parsing SCSS stylesheets +* Librarian (bundled as a git submodule, remember to ``git submodule update --init`` +* Librarian has more dependencies if you want to build PDF and MOBI files, + see lib/librarian/README.md +* `Solr <https://lucene.apache.org/solr/>`_ server if you want to search Running ------- +Set up the database with:: + + ./manage.py syncdb --migrate -You can run the server with:: +Run the dev server with:: ./manage.py runserver -If you want to run lengthy tasks (like generating e-book files) in a seperate -Celery process (this is the default), you'll also need to run: +Some tasks (like generating e-books) run in a seperate +Celery process by default, so you'll also need to run:: - ./manage.py celeryd --loglevel=INFO + celery -A wolnelektury worker --loglevel=INFO -If you don't want to run a separate Celery daemon, make sure you set this -option in your ``localsettings.py``:: +Or, if you don't want to run a separate Celery daemon, set this +in your ``localsettings.py``:: CELERY_ALWAYS_EAGER = True @@ -44,16 +41,22 @@ Deployment ---------- Setup your server in fabfile.py and do:: - fab <your_server_name> setup + fab <your_server_name> deploy -Aside from uploading a current (git's HEAD) version of the app this will also -download all dependencies into a `virtualenv <http://www.virtualenv.org>`_, -create a VHost and WSGI files for running with Apache and mod_wsgi, and -a celery config file for `supervisord <http://supervisord.org/>`_. +Initial deploy will stop and ask you to provide a localsettings.py file. +A sample localsettings.py will be put on your server, as well as +sample configuration for `Nginx <http://nginx.org/>`_, +`Gunicorn <http://gunicorn.org/>`_ and +`Supervisord <http://supervisord.org/>`_. -To deploy a new version into an existing setup, do: - fab <your_server_name> deploy +Publishing books +---------------- + +Books are represented as XML files. +You can import XML files from a directory by running:: + + ./manage.py importbooks ../books -This will also check for new dependencied, migrate your app and restart the -WSGI server and Celery under supervisord. +Or you can publish a single XML by using publishing form in admin, +or the publishing API.