{"id":20652317,"url":"https://github.com/openpolis/django-eztaskmanager","last_synced_at":"2026-02-16T10:32:56.524Z","repository":{"id":230092783,"uuid":"778201455","full_name":"openpolis/django-eztaskmanager","owner":"openpolis","description":"This Django application empowers the efficient management and scheduling of asynchronous tasks within the Django Admin, featuring task notifications and report generation capabilities.","archived":false,"fork":false,"pushed_at":"2025-01-03T17:26:39.000Z","size":2584,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T06:33:23.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openpolis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-27T09:21:12.000Z","updated_at":"2025-01-03T17:23:49.000Z","dependencies_parsed_at":"2024-03-27T20:29:36.327Z","dependency_job_id":"d1bd94d6-e469-4a1c-b26f-fba93739cfc0","html_url":"https://github.com/openpolis/django-eztaskmanager","commit_stats":null,"previous_names":["openpolis/django-eztaskmanager"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpolis%2Fdjango-eztaskmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpolis%2Fdjango-eztaskmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpolis%2Fdjango-eztaskmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpolis%2Fdjango-eztaskmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openpolis","download_url":"https://codeload.github.com/openpolis/django-eztaskmanager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249517795,"owners_count":21284837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T17:33:52.031Z","updated_at":"2026-02-16T10:32:56.488Z","avatar_url":"https://github.com/openpolis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nDjango application to manage common django management tasks\n*asynchronously*, via the Django admin interface, using [`Redis Queue`](https://github.com/rq/rq).\n\n\u003e **_NOTE:_** Right now, **django-eztaskmanager** is built to play nice with RQ (Redis Queue).\n   It does the job, and does it well. But I know some of you out there swear by Celery, and I hear you.\n   It's on my radar and I'm knee-deep in code working to get it integrated.\n   So, keep an eye out for updates!\n\n**eztaskmanager** is a port and an evolution of our previous \n[django-uwsgi-taskmanager](https://github.com/openpolis/django-uwsgi-taskmanager), so thanks to the authors there.\n\nMain **features**:\n\n- use standard django management commands as tasks *templates*,\n- import available management commands through a meta-management command, as possible templates for tasks,\n- start and stop tasks manually via admin,\n- schedule point and periodic tasks via django admin,\n- use RQ (rq + rq-scheduler) or Celery (celery + celery-beat) for queue management,\n- check or download the generated reports/logs,\n- live logs streaming view, with filters on errors and warnings for tasks debugging,\n- get notifications via Slack or email when a task succeeds or fails.\n\nSee full documentation at http://django-eztaskmanager.rtfd.io/\n\n## Installation\n\n1. Install the app with `pip`:\n\n    -  via PyPI:\n\n       `pip install django-eztaskmanager`\n\n    -  or via GitHub:\n\n       `pip install git+https://github.com/openpolis/django-eztaskmanager.git`\n\n2. Add \"eztaskmanager\" to your `INSTALLED_APPS` setting like this:\n\n    ```python\n   \n    INSTALLED_APPS = [\n        \"django.contrib.admin\",\n        # ...\n        \"eztaskmanager\",\n    ]\n    ```\n\n3. Run `python manage.py migrate` to create the taskmanager tables.\n\n4. Run `python manage.py collectcommands --excludecore` to import taskmanager commands.\n\n5. Include the taskmanager URLConf (for the log viewers) in your project `urls.py` like this _(optional)_:\n\n    ```python\n\n    from django.contrib import admin\n    from django.urls import include, path\n    \n    urlpatterns = [\n        path(\"admin/\", admin.site.urls),\n        path('eztaskmanager/', include('eztaskmanager.urls'))\n    ]\n    ```\n\n6. Set parameters in your settings file as below _(optional)_:\n\n    ```python\n\n    # eztaskmanager\n    # EZTASKMANAGER_QUEUE_SERVICE_TYPE = 'RQ'\n    # EZTASKMANAGER_N_LINES_IN_REPORT_LOG = 10\n    # EZTASKMANAGER_N_REPORTS_INLINE = 10\n    # EZTASKMANAGER_SHOW_LOGVIEWER_LINK = True\n    # EZTASKMANAGER_USE_FILTER_COLLAPSE = True\n    # EZTASKMANAGER_NOTIFICATION_HANDLERS = {}\n    # EZTASKMANAGER_BASE_URL = None\n    EZTASKMANAGER_NOTIFICATION_HANDLERS = {\n        \"email-errors\": {\n            \"class\": \"eztaskmanager.services.notifications.EmailNotificationHandler\",\n            \"level\": \"failure\",\n            \"from_email\": \"admin@example.com\",\n            \"recipients\": [\"admin@example.com\", ],\n        },\n    }\n    EZTASKMANAGER_N_LINES_IN_REPORT_LOG = 5\n    ```\n\n## Usage\n\nYou just need to install `django-eztaskmanager` in your Django Project and run `collectcommands` as described.\nDjango ezaskmanager will collect all the commands and make them available for asynchronous scheduling in the admin.\n\nIf you need a new asynchronous task, just write a standard custom Django command \nusing `eztaskmanager.services.logger.LogEnabledCommand` in places of `django.core.management.base.BaseCommand`, \nand synchronize the app. Then go to the admin page and schedule it.\n\nYou can disable commands from the admin, and let users (with limited permissions) schedule only the available ones.\n\n\u003e **NOTE**: RQ or Celery workers and schedulers (rq-scheduler or celery-beat) need to be up and running\n\n## Enabling notifications\n\nTo enable Slack notifications support for failing tasks, you have to first install the\nrequired packages, which are not included by default. To do that, just:\n\n    pip install django-eztaskmanager[notifications]\n    \nThis will install the `django-eztaskmanager` package from PyPI, including the optional dependencies\nrequired to make Slack notifications work. \n\nEmail notifications are instead handled using Django [`django.core.mail`](https://docs.djangoproject.com/en/5.0/topics/email/) \nmodule, so no further dependencies are needed and they should work out of the box, given you have at\nleast one [email backend](https://docs.djangoproject.com/en/5.0/topics/email/#email-backends) properly\nconfigured.\n\nThen, you have to configure the following settings:\n\n- `EZTASKMANAGER_NOTIFICATIONS_SLACK_TOKEN`, which must be set with you own Slack token as string.\n- `EZTASKMANAGER_NOTIFICATIONS_SLACK_CHANNELS`, a list of strings representing the names or ids of the channels which will receive the notifications.\n- `EZTASKMANAGER_NOTIFICATIONS_EMAIL_FROM`, the \"from address\" you want your outgoing notification emails to use.\n- `EZTASKMANAGER_NOTIFICATIONS_EMAIL_RECIPIENTS`, a list of strings representing the recipients of the notifications.\n\n### The demo tutorial (RQ)\nFollowing this tutorial, it will be possible to install, configure and use **eztaskmanager** for a\nsimple demo django project running in developer mode, with the RQ engine.\n\nClone the project from github onto your hard disk:\n\n```bash\n    git clone https://github.com/openpolis/django-eztaskmanager\n    cd django-eztaskmanager\n```\n\nThere is a basic Django project under the ``demoproject`` directory, set to use ``eztaskmanager``.\n\n```\n    demoproject/\n    ├── demoproject/\n    │   ├── __init__.py\n    │   └── asgi.py\n    │   ├── settings.py\n    │   ├── test_settings.py\n    │   ├── urls.py\n    │   └── wsgi.py\n    ├── manage.py\n    ├── static/\n    └── docker-compose-local.yml\n```\n\n#### Try the demo project\n\nAs a **pre-requisite**, a Redis server should be up and running on the default port 6379.\nFollow the instructions_, or if you use docker_, just run ``docker compose -f docker-compose-local.yml``.\n\nEnter the ``demoproject`` directory, then create and activate the virtual environments:\n\n```bash\n    $ cd demoproject\n    $ mkdir -p venv\n    $ python3 -m venv venv\n    $ source venv/bin/activate\n```\n\nInstall **eztaskmanager**, this will install all needed dependencies (django, redis, django-rq, rq-scheduler,...):\n\n```bash\n    (venv) $ pip install django-eztaskmanager\n```\n\nThen execute this commands to setup the server in development mode, the rq worker and the scheduler:\n\n```bash\n    (venv) $ python manage.py migrate  # create tables in the DB (default sqlite will do)\n    (venv) $ python manage.py createsuperuser # take note of username and password for login\n    (venv) $ python manage.py collectcommands --excludecore  # collect basic commands from the eztaskmanager package\n    (venv) $ python manage.py runserver  # django app server on port 8000\n    (venv) $ python manage.py rqworker  # rq worker to execute enqueued tasks\n    (venv) $ python manage.py rqscheduler --verbosity=3  # rq scheduler to enqueue periodic tasks\n```\n\nVisit http://127.0.0.1:8000/admin/\n\n## Development and Testing\n\n### Running Tests\n\nThe project uses Django's test framework. Tests are located in `eztaskmanager/tests/`.\n\nTo run the test suite:\n\n```bash\n# Install development dependencies with Poetry\npoetry install\n\n# Run all tests\nexport PYTHONPATH=\"${PYTHONPATH}:$(pwd)\"\npoetry run python demoproject/manage.py test --verbosity=2\n\n# Run specific test module\npoetry run python demoproject/manage.py test eztaskmanager.tests.test_services\n\n# Run tests with coverage\npoetry run coverage run demoproject/manage.py test\npoetry run coverage report\n```\n\n### Code Quality\n\n```bash\n# Format code with black\npoetry run black eztaskmanager/\n\n# Run flake8 linting\npoetry run flake8 eztaskmanager/\n\n# Type checking with mypy\npoetry run mypy eztaskmanager/\n```\n\n## Copyright\n\nDjango eztaskmanager is an application to manage common django management tasks\n*asynchronously*, via the Django admin interface, using Redis Queue.\n\n    Copyright (c) 2024 Guglielmo Celata (django-eztaskmanager)\n    Copyright (C) 2019-2020 Gabriele Giaccari, Gabriele Lucci, Guglielmo Celata, Paolo Melchiorre (django-uwsgi-taskmanager)\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as\n    published by the Free Software Foundation, either version 3 of the\n    License, or (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpolis%2Fdjango-eztaskmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenpolis%2Fdjango-eztaskmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpolis%2Fdjango-eztaskmanager/lists"}