Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/atrox/sweetify-django

SweetAlert integration for Django
https://github.com/atrox/sweetify-django

django messages python python3 sweetalert sweetalert2

Last synced: about 1 month ago
JSON representation

SweetAlert integration for Django

Awesome Lists containing this project

README

        

# Sweetify - SweetAlert for Django

[![Build Status](https://img.shields.io/travis/Atrox/sweetify-django.svg?style=flat-square)](https://travis-ci.org/Atrox/sweetify-django)
[![Latest Version](https://img.shields.io/pypi/v/sweetify.svg?style=flat-square)](https://pypi.python.org/pypi/sweetify)
[![Coverage Status](https://img.shields.io/coveralls/Atrox/sweetify-django.svg?style=flat-square)](https://coveralls.io/r/Atrox/sweetify-django)

**Sweetify** allows you to use [SweetAlert](http://t4t5.github.io/sweetalert/) or [SweetAlert2](https://github.com/limonte/sweetalert2) for your temporary messages.
_See the examples below, to see how to use this library_

## Installation

**Note: This package does not provide the client-side files of SweetAlert. You have to provide them yourself.**

Install the latest version with `pip`:

```bash
pip install --upgrade sweetify
```

Then you have to add `sweetify` to your django apps:

```python
INSTALLED_APPS = [
...
'sweetify'
]
```

Next up you have to specify, in your settings, which library you are using (SweetAlert or SweetAlert2):

```python
# possible options: 'sweetalert', 'sweetalert2' - default is 'sweetalert2'
SWEETIFY_SWEETALERT_LIBRARY = 'sweetalert2'
```

Next add the following lines to the bottom of your layout/base template:

```jinja
...

{% load sweetify %}
{% sweetify %}