I read this https://github.com/Atrox/sweetify-django documentation about sweetify, and i did everything say in the documentation.but everytime the user admin Insert new data, the sweetify didnt activate, did i miss something? I already install it. I am using django 2.2.4
I have this code in my html
{% load sweetify %}
{% sweetify %}
<form method="POST" action-xhr="/InsertProduct/" enctype="multipart/form-data">
{% csrf_token %}
....
<button type="submit" name="submit" id="submit">Submit</button>
</form>
this is my views.py
import sweetify
def InsertProduct(request):
....
insert_data = Product(
....
)
sweetify.success(request, 'You did it', text='Good job! You successfully showed a SweetAlert message', persistent='Hell yeah')
insert_data.save()
return redirect('/') # <-- tabbed this line
sweetify.py
from sweetify.templatetags import sweetify
sweetify.DEFAULT_OPTS = {
'showConfirmButton': False,
'timer': 2500,
'allowOutsideClick': True,
'confirmButtonText': 'OK',
}
settings.py
INSTALLED_APPS = [
.....
'sweetify',
]
SWEETIFY_SWEETALERT_LIBRARY = 'sweetalert2'