diff options
author | Markus Zapke-Grùˆndemann <info@keimlink.de> | 2012-01-05 13:02:22 +0100 |
---|---|---|
committer | Markus Zapke-Grùˆndemann <info@keimlink.de> | 2012-01-05 13:02:22 +0100 |
commit | b8e440961f6a35ad3621b06d642f12b6bb364e31 (patch) | |
tree | b2b9997a64df354be6fecea43d153e6b0996f7b5 | |
parent | 2e57029856e619d2934135e7b01a457bbbc97f88 (diff) |
Added development setup how to.
-rw-r--r-- | README.rst | 80 |
1 files changed, 80 insertions, 0 deletions
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 <http://www.python-ldap.org/doc/html/installing.html#prerequisites>`_. + On OS X you need to `reinstall the OpenLDAP Libraries <http://projects.skurfer.com/posts/2011/python_ldap_lion/>`_. + +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/ |