All Projects → openpolis → Django Uwsgi Taskmanager

openpolis / Django Uwsgi Taskmanager

Licence: agpl-3.0
Django application to monitor and manage long and/or recurring tasks through uWSGI.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Uwsgi Taskmanager

Docker Django Nginx Uwsgi Postgres Tutorial
Docker + Django + Nginx + uWSGI + Postgres 基本教學 - 從無到有 ( Docker + Django + Nginx + uWSGI + Postgres Tutorial )
Stars: ✭ 334 (+1418.18%)
Mutual labels:  django, uwsgi
Django Init
Project template used at Fueled for scaffolding new Django based projects. 💫
Stars: ✭ 126 (+472.73%)
Mutual labels:  django, uwsgi
Autoops
linux资产管理,cmdb,django, webssh,运维管理平台,数据库操作平台 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 340 (+1445.45%)
Mutual labels:  django, uwsgi
Docker Django
A project to get you started with Docker and Django.
Stars: ✭ 170 (+672.73%)
Mutual labels:  django, uwsgi
Opman Django
💯✅自动化运维平台:CMDB、CI/CD、DevOps、资产管理、任务编排、持续交付、系统监控、运维管理、配置管理
Stars: ✭ 539 (+2350%)
Mutual labels:  django, uwsgi
Django Oidc Rp
A server side OpenID Connect Relying Party (RP, Client) implementation for Django.
Stars: ✭ 16 (-27.27%)
Mutual labels:  django
Django2.0 Course
Django2.0视频教程相关代码(杨仕航)
Stars: ✭ 897 (+3977.27%)
Mutual labels:  django
Django Mypy
A django project to show use of mypy
Stars: ✭ 7 (-68.18%)
Mutual labels:  django
Server
The Etebase server (so you can run your own)
Stars: ✭ 826 (+3654.55%)
Mutual labels:  django
Django Source
django 源码剖析
Stars: ✭ 20 (-9.09%)
Mutual labels:  django
Django Photoblog
Photographer portfolio website powered by Django Framework. Features photo gallery with infinite scrolling, tagging, thumbnail generation and CMS for creating pages. Configured for Heroku and S3.
Stars: ✭ 19 (-13.64%)
Mutual labels:  django
Django Ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Stars: ✭ 875 (+3877.27%)
Mutual labels:  django
Heroku Django Template
A Django 2.0 base template featuring all recommended best practices for deployment on Heroku and local development.
Stars: ✭ 887 (+3931.82%)
Mutual labels:  django
Django Beginners Guide
A Complete Beginner's Guide to Django - Code Samples
Stars: ✭ 902 (+4000%)
Mutual labels:  django
Seeker
Seeker - another job board aggregator.
Stars: ✭ 16 (-27.27%)
Mutual labels:  django
Django Login Registration
Django user registration and login with form validation
Stars: ✭ 19 (-13.64%)
Mutual labels:  django
Django Rest Framework Gis
Geographic add-ons for Django REST Framework. Maintained by the OpenWISP Project.
Stars: ✭ 830 (+3672.73%)
Mutual labels:  django
Django rest example
Django/DRF rest application example.
Stars: ✭ 17 (-22.73%)
Mutual labels:  django
Django Phantom Theme
Phantom is theme for django admin with many widgets, based on Twitter bootstrap 3.x.
Stars: ✭ 18 (-18.18%)
Mutual labels:  django
Campus42
Website that allows 42 Silicon Valley students to find each other on the map
Stars: ✭ 17 (-22.73%)
Mutual labels:  django

Django uWSGI Taskmanager

Code style: black

Django application to manage async tasks via admin interface, using uWSGI spooler.

See documentation at http://django-uwsgi-taskmanager.rtfd.io/

Features

  • Start and stop your tasks via admin
  • Schedule tasks
  • Plan tasks as cron items
  • Check or download the generated reports/logs
  • Simply write a standard Django Command class (your app doesn't need to interact with Django uWSGI Taskmanager)
  • Get notifications via Slack or email when a task fails

Installation

  1. Install the app with pip:

    • via PyPI:

      pip install django-uwsgi-taskmanager

    • or via GitHub:

      pip install git+https://github.com/openpolis/django-uwsgi-taskmanager.git

  2. Add "taskmanager" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        "django.contrib.admin",
        # ...
        "taskmanager",
    ]
    
  3. Run python manage.py migrate to create the taskmanager tables.

  4. Run python manage.py collectcommands to create taskmanager commands.

  5. Include the taskmanager URLConf in your project urls.py like this (optional):

    from django.contrib import admin
    from django.urls import include, path
    
    urlpatterns = [
        path("admin/", admin.site.urls),
        path("taskmanager/", include("taskmanager.urls")),
    ]
    
  6. Set parameters in your settings file as below (optional):

    UWSGI_TASKMANAGER_N_LINES_IN_REPORT_INLINE = 10
    UWSGI_TASKMANAGER_N_REPORTS_INLINE = 3
    UWSGI_TASKMANAGER_SHOW_LOGVIEWER_LINK = True
    UWSGI_TASKMANAGER_USE_FILTER_COLLAPSE = True
    UWSGI_TASKMANAGER_SAVE_LOGFILE = False
    

Usage

You just need to install django-uwsgi-taskmanager in your Django Project and run collectcommands as described. Django uWSGI Taskmanager will collect all the commands and make them available for asynchronous scheduling in the admin.

If you need a new asynchronous task, just write a standard custom Django command, and synchronize the app. Then go to the admin page and schedule it.

You can disable some commands from the admin, and let users (with limited permissions) schedule only the available ones.

uWSGI ini file (vassal) has to include the spooler and pythonpath option.

NOTE: remember to manually create the spooler directory with right permissions before start uWSGI

Enabling notifications

To enable Slack notifications support for failing tasks, you have to first install the required packages, which are not included by default. To do that, just:

pip install django-uwsgi-taskmanager[notifications]

This will install the django-uwsgi-taskmanager package from PyPI, including the optional dependencies required to make Slack notifications work.

Email notifications are instead handled using Django django.core.mail module, so no further dependencies are needed and they should work out of the box, given you have at least one email backend properly configured.

Then, you have to configure the following settings:

  • UWSGI_TASKMANAGER_NOTIFICATIONS_SLACK_TOKEN, which must be set with you own Slack token as string.
  • UWSGI_TASKMANAGER_NOTIFICATIONS_SLACK_CHANNELS, a list of strings representing the names or ids of the channels which will receive the notifications.
  • UWSGI_TASKMANAGER_NOTIFICATIONS_EMAIL_FROM, the "from address" you want your outgoing notification emails to use.
  • UWSGI_TASKMANAGER_NOTIFICATIONS_EMAIL_RECIPIENTS, a list of strings representing the recipients of the notifications.

Demo

This a basic Django demo project with a uwsgi.ini file and four directories (media, spooler, static, venv).

demo/
├── demo/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── manage.py
├── media/
├── spooler/
├── static/
├── uwsgi.ini
└── venv/

This is the content of uwsgi.ini file required to execute the project with Django:

[uwsgi]
chdir = %d
env = DJANGO_SETTINGS_MODULE=demo.settings
http-socket = :8000
master = true
module = demo.wsgi
plugin = python3
pythonpath = %d
spooler = %dspooler
static-map = /static/=%dstatic
virtualenv = %dvenv

Try the demo project

Enter the demo directory, then create and activate the demo virtual environments:

$ cd demo
$ mkdir -p venv
$ python3 -m venv ./venv
$ source ./venv/bin/activate

Install Django uWSGI taskmanager:

(venv) $ pip install django-uwsgi-taskmanager

Install uWSGI (if you use uWSGI of your OS you can skip this step):

(venv) $ pip install uwsgi

Collect all static files:

(venv) $ python manage.py collectstatic

Create all the tables:

(venv) $ python manage.py migrate

Collect all commands:

(venv) $ python manage.py collectcommands

Create a super user to login to the admin interface:

(venv) $ python manage.py createsuperuser

Start the project with uWSGI:

(venv) $ uwsgi --ini uwsgi.ini

Visit http://127.0.0.1:8000/admin/

Copyright

Django uWSGI taskmanager is an application to manage async tasks via admin interface, using uWSGI spooler.

Copyright (C) 2019-2020 Gabriele Giaccari, Gabriele Lucci, Guglielmo Celata, Paolo Melchiorre

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].