Metadata-Version: 2.1
Name: django-alert-winglet
Version: 0.1.7
Summary: Seamlessly Send Django or Python Exceptions to Discord Channels!
Author: Mojtaba
Author-email: Mojtabadavi14@gmail.com
License: MIT License
Project-URL: Issues, https://github.com/Mojitaba34/alert-winglet/issues
Project-URL: Source Code, https://github.com/Mojitaba34/alert-winglet
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE

alert-winglet
=============

A Django app to send any exception to a Discord channel.

Quick start
-----------

Installation
------------

You can install ``django-alert-winglet`` using ``pip``::
    pip install django-alert-winglet

1. Add "alert_winglet" to your `INSTALLED_APPS` setting in your Django project's settings file::

    INSTALLED_APPS = [
        ...,
        "alert_winglet",
    ]

Discord
-------

1. Set the `DISCORD_WEBHOOK_URL` variable in your Django settings. This is the URL of the Discord webhook you want to use for sending exceptions.

2. Use the `DiscordEmbedManager` class to create a Discord Embed object. ::

    from alert_winglet.discord.manager import DiscordEmbedManager

    # If the request is not provided, the `extra_detail` variable will be None
    discord_manager = DiscordEmbedManager(
          exc,
      )
    formatted_exc, extra_detail = discord_manager.format_exception()
    data = discord_manager.prepare_embed_data(formatted_exc, extra_detail)

3. Then use the `DiscordDelivery` class to send the exception to your Discord channel using the webhook.
This class can be used for other purposes as well, like sending messages or files... . ::

    from alert_winglet.discord.sender import DiscordDelivery

    delivery = DiscordDelivery(
        embeds=[
            data,
        ]
    )
    delivery.send()


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

- django >= 3.0
- discord.py >=2.2.3
- requests >=2.28.2

License
-------

This project is licensed under the MIT License.

Bug Reports and Feature Requests
--------------------------------

Please use the GitHub_issue_ tracker to report any bugs or submit feature requests.

Authors
-------

- Mojtaba Davi
- Email: Mojtabadavi14@gmail.com


.. _GitHub_issue: https://github.com/Mojitaba34/alert-winglet/issues
