1👍
✅
You would normally use the ‘messages’ framework for this. See the docs at https://docs.djangoproject.com/en/dev/ref/contrib/messages/
This way you can send different messages. For example one for ‘succesfully added’ and one for ‘succesfully edited’ that can than be shown to the user.
0👍
I would suggest that you could do a query string from add page to details page.
// when add page is submitted, and redirect to details page with query string
def details(request):
added = request.GET.get('added',''):
if added:
// renders the page with Book XYZ added successfully
Excuse me for the pseudoCode
- [Answer]-Proper Way to Fetch Latest Addition to Django Model
- [Answer]-Fast and efficient random queryset – Django
Source:stackexchange.com