Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hanz-archer/viewstofrontendsweetalertjs
- Owner: hanz-archer
- Created: 2024-11-28T00:25:05.000Z (29 days ago)
- Default Branch: master
- Last Pushed: 2024-11-28T00:29:50.000Z (29 days ago)
- Last Synced: 2024-11-28T01:27:23.172Z (29 days ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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