Go to file
Anler Hp 0e414267db Integration with RabbitMQ and Celery
First update taiga-vagrant vm if you're using it, you will have access
to the rabbit management console at port 8001 of the host machine.

* Defining tasks
- Tasks must be defined in a `deferred` module of an app, for example,
`taiga.projects.deferred` module.
- Tasks must be decorated and given the name "<app>.<task-name>", for
example in `taiga.projects.deferred` module:
```
from taiga.celery import app

@app.task(name="projects.add")
def add(x, y):
    return x + y
```
- Tasks should be at most just wrappers around service functions to
promote re-usability of those functions from other parts of the code,
say, management commands and the like.

* Calling tasks
Tasks should be called using one of the three functions defined in
`taiga.deferred` module:

- `defer`: Use this function if you need to perform some task
asynchronously and GET THE RESULT back later, for example:
```
result = defer("projects.add", x=1, y=2)
...
result.get() # => 3
```

- `call_async`: Use this function when you want to fire off some
task. No result is get back. For example:
```
call_async("projects.email_user", user)
```

- `apply_async`: Is the same as `call_async` but since it's a function
application and you must pass the args and kwargs together as one
parameter each you are allowed to pass celery-specific
extra-options (but bear in mind this is not recommended!)
```
apply_async("projects.email_user", args=(user,), kwargs={}, routing_key="tasks.email")
```
2014-07-02 09:49:56 +02:00
doc Remove the coding lines 2014-04-25 12:33:16 +02:00
settings Integration with RabbitMQ and Celery 2014-07-02 09:49:56 +02:00
sql Minor fixes on tags sql file. 2014-05-28 12:51:34 +02:00
taiga Integration with RabbitMQ and Celery 2014-07-02 09:49:56 +02:00
tests Integration with RabbitMQ and Celery 2014-07-02 09:49:56 +02:00
.ctags Adding .ctags config file to the repository 2014-03-20 13:59:41 +01:00
.gitignore Remove domains. 2014-05-26 17:33:12 +02:00
.travis.yml Set native traceback to travis.yml 2014-06-12 00:12:44 +02:00
AUTHORS.rst Update AUTHORS 2014-06-22 11:30:19 +02:00
LICENSE Replace main license file. 2014-04-21 15:29:21 +02:00
NOTICE Some Apache license references removed 2014-04-21 16:34:02 +02:00
README.rst Update README.rst 2014-07-02 08:08:48 +02:00
manage.py Move settings to project repo root path. 2014-02-28 12:10:25 +01:00
pytest.ini Configure PYTHONPATH when running py.test 2014-04-30 09:06:15 +02:00
regenerate.sh Remove domains. 2014-05-26 17:33:12 +02:00
requirements-devel.txt Update dev requirements 2014-06-05 10:36:22 +02:00
requirements.txt Integration with RabbitMQ and Celery 2014-07-02 09:49:56 +02:00

README.rst

Taiga Backend
=================

.. image:: http://kaleidos.net/static/img/badge.png
    :target: http://kaleidos.net/community/taiga/

.. image:: https://travis-ci.org/taigaio/taiga-back.png?branch=master
    :target: https://travis-ci.org/taigaio/taiga-back

.. image:: https://coveralls.io/repos/taigaio/taiga-back/badge.png?branch=master
    :target: https://coveralls.io/r/taigaio/taiga-back?branch=master


Setup development environment
-----------------------------

Just execute these commands in your virtualenv(wrapper):

.. code-block:: console

    pip install -r requirements.txt
    python manage.py syncdb --all --noinput
    python manage.py migrate --fake
    python manage.py loaddata initial_user
    python manage.py loaddata initial_project_templates
    python manage.py loaddata initial_role
    python manage.py sample_data

You have to load the sql sentences of the file ``sql/tags.sql`` and your database
must support PL/Python. You use a dbuser with privileges in the database,
'taiga' for example, to do this.

.. code-block:: console

    psql taiga

.. code-block:: sql

    CREATE LANGUAGE plpythonu;

    CREATE OR REPLACE FUNCTION unpickle (data text)
        RETURNS text[]
    AS $$
        import base64
        import pickle

        return pickle.loads(base64.b64decode(data))
    $$ LANGUAGE plpythonu IMMUTABLE;

    CREATE INDEX issues_unpickle_tags_index ON issues_issue USING btree (unpickle(tags));


Note: taiga only runs with python 3.3+.

Note: Initial auth data: admin/123123


Polyfills
---------

Django-Rest Framework by default returns 403 for not authenticated requests and permission denied
requests. The file ``taiga/base/monkey.py`` contains a temporary fix for this bug.

This patch is applied when the module ``base.models`` it's loaded. Once it's solved on django rest
framework, this patch can be removed.