-
Clone the repository
git clone https://github.com/dldevinc/paper-rq
-
Create a virtualenv
cd paper-rq virtualenv .venv
-
Activate virtualenv
source .venv/bin/activate
-
Install dependencies as well as a local editable copy of the library
pip install -r ./requirements.txt pip install -e .
-
Run test project
python3 manage.py migrate python3 manage.py loaddata tests/fixtures.json
python3 manage.py runserver
Django admin credentials:
admin
/admin
We use pre-commit
hooks to simplify linting
and ensure consistent formatting among contributors. Use of pre-commit
is not a requirement, but is highly recommended.
pip install pre-commit
pre-commit install
Commiting will now automatically run the local hooks and ensure that your commit passes all lint checks.
Put some tasks into queue:
import random
import django_rq
from time import sleep
queue = django_rq.get_queue("paper:default")
for _ in range(30):
queue.enqueue(sleep, random.randint(5, 30))
Run the RQ queue:
python3 manage.py rqworker