Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/atrox/sweetify-django
- Owner: Atrox
- License: bsd-3-clause
- Created: 2017-09-06T18:25:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-21T21:51:48.000Z (almost 2 years ago)
- Last Synced: 2024-12-26T20:14:02.711Z (about 1 month ago)
- Topics: django, messages, python, python3, sweetalert, sweetalert2
- Language: Python
- Size: 104 KB
- Stars: 54
- Watchers: 4
- Forks: 21
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 %}