semvec/pypi-packages huggingface dataset:
django-monitus 1.0.0
Tiny error reporting middleware(s) for Django.
License: MIT License
Requires Python: >=3.7
Keywords: django,middleware,notification,admins

===================
django-monitus
===================

.. image:: https://img.shields.io/twitter/follow/gagliardi_vale?style=social
   :target: https://twitter.com/gagliardi_vale

.. image:: https://github.com/valentinogagliardi/django-monitus/workflows/Tox%20tests/badge.svg
   :target: https://github.com/valentinogagliardi/django-monitus/actions

Tiny error reporting middleware(s) for Django. Includes the following middlewares:

- ``Error403EmailsMiddleware``: sends an email to ``ADMINS`` on 403.
- ``FailedLoginMiddleware``: sends an email to ``ADMINS`` on failed logins.

Requirements
------------

Tested on Python 3.8.

Tested on Django 3.0 and 3.1.

Setup
------------
Install from pip:

.. code-block:: sh

    python -m pip install django-monitus

Then add it to the list of installed apps:

.. code-block:: python

    INSTALLED_APPS = [
    ...
    "monitus"
    ...
    ]

Enable the desired middleware:

.. code-block:: python

    MIDDLEWARE = [
    ...
    "monitus.middleware.Error403EmailsMiddleware"
    ...
    ]

Setup ``ADMINS`` in your settings:

.. code-block:: python

    MANAGERS = [("Juliana C.", "juliana.crain@dev.io")]

Development and testing
-----------------------

To test on your local machine with Postgres, make sure to have a role with enough privileges:

.. code-block:: bash

    CREATE ROLE monitustestuser WITH LOGIN PASSWORD 'monitustestpassword' CREATEDB;

Then run

.. code-block:: bash

    DATABASE_URL=postgres://monitustestuser:monitustestpassword@localhost/monitustestdb tox