summaryrefslogtreecommitdiff
path: root/README.rst
blob: 2681367988c9f096ba2ec7adff847e61f0d1a3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 and run the migrations::

    (sublab_website)$ ./manage.py syncdb --noinput --migrate

Then create a superuser::

    (sublab_website)$ $ ./manage.py createsuperuser

Finally start the development webserver::

    (sublab_website)$ ./manage.py runserver

To use the task queue you need to have redis-server installed. Use supervisord
to start the Celery_ daemons, redis-server and runserver with one command::

    (sublab_website)$ ./manage.py supervisor

License
=======

This software is licensed under the New BSD License. See the LICENSE file in
the top distribution directory for the full license text.

..  _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/