Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hanz-archer/viewstofrontendsweetalertjs

My template that shows passing messages and display it in sweetalert in Django
https://github.com/hanz-archer/viewstofrontendsweetalertjs

Last synced: 9 days ago
JSON representation

My template that shows passing messages and display it in sweetalert in Django

Awesome Lists containing this project

README

        

Backend: Sending Messages from Django Views
In your Django views, you can use the messages framework to send feedback to the user. For example, consider the login_view function where we authenticate the user based on the submitted username and password. If the login is successful, the system sets a success message, and if the login fails, an error message is added instead.

Ill pass this ----> messages.error(request, 'Invalid credentials. Please try again.') # Set an error message