How to install django-uwsgi-taskmanager in an existing project

This documentation is for developers, that want to add this application to their django project.

Note

As a pre-requisite, the project should already be served through uWSGI.

  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 collectcommands management task to create taskmanager commands 1:

    python manage.py collectcommands --excludecore
    
  5. Include the taskmanager URLConf in your project urls.py (optional) 2:

    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
    
  7. Configure the notifications, following the How to enable notifications guide (optional).

Footnotes

1

excludecore ensures that core django tasks are not fetched.

2

the /taskmanager/logviewer view is added to show the complete logs message.