From b8e440961f6a35ad3621b06d642f12b6bb364e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Thu, 5 Jan 2012 13:02:22 +0100 Subject: Added development setup how to. --- README.rst | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 README.rst diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..592a297 --- /dev/null +++ b/README.rst @@ -0,0 +1,80 @@ +sublab website +************** + +Prerequisites +============= + +- Python_ +- Git_ +- virtualenv_ (optional, but recommended) +- virtualenvwrapper_ (optional, makes your life easier) +- pip_ +- Redis_ (only needed for the task queue) + +How to setup a development machine +================================== + +First clone the repository:: + + $ git clone git://git.sublab.org/subweb + +*The next step is optional but is much more easier to work with an virtual +environment instead installing everything inside your Python installation.* + +Create a virtual environment using virtualenv_ somewhere and activate it (you +can also use virtualenvwrapper_ instead if you like):: + + $ virtualenv --no-site-packages --distribute sublab_website + $ cd sublab_website + $ . bin/activate + +Install the Python packages inside the activated virtual environment, inluding +the ones for development:: + + (sublab_website)$ cd subweb + (sublab_website)$ pip install -r requirements_dev.txt + +Some of the Python packages need additional libraries. It depends on your +platform which libraries you need to install. + +PIL_ + You need will `jpeg` and `zlib` libraries to compile PIL. Use your + favorite package manager to install them. + +python-ldap_ + See `python-ldap prerequisites `_. + On OS X you need to `reinstall the OpenLDAP Libraries `_. + +Create a symlink to the development settings:: + + (sublab_website)$ cd sublab_project + (sublab_website)$ ln -s ../conf/dev_settings.py local_settings.py + +Now create the database:: + + (sublab_website)$ ./manage.py syncdb + (sublab_website)$ ./manage.py migrate + +Finally start the development webserver:: + + (sublab_website)$ ./manage.py runserver + +To run the task queue you need to start Redis first. Then start the Celery_ +daemon in a new terminal:: + + (sublab_website)$ ./manage.py celeryd -B -E -l info + +To be able to see the tasks in the Django admin you need to start +``celerycam`` in a third terminal:: + + (sublab_website)$ ./manage.py celerycam + +.. _Python: http://python.org/ +.. _Git: http://git-scm.com/ +.. _pip: http://www.pip-installer.org/ +.. _Redis: http://redis.io/ +.. _virtualenv: http://www.virtualenv.org/ +.. _virtualenvwrapper: http://www.doughellmann.com/projects/virtualenvwrapper/ +.. _PIL: http://www.pythonware.com/products/pil/ +.. _python-ldap: http://www.python-ldap.org/ +.. _Celery: http://celeryproject.org/ -- cgit v1.2.1