Questions tagged [django-messages]

Notification messages framework for Django

The messages framework

Quite commonly in web applications, you need to display a one-time notification message (also known as “flash message”) to the user after processing a form or some other types of user input.

For this, Django provides full support for cookie- and session-based messaging, for both anonymous and authenticated users. The messages framework allows you to temporarily store messages in one request and retrieve them for display in a subsequent request (usually the next one). Every message is tagged with a specific level that determines its priority (e.g., info, warning, or error).

155 questions
0
votes
1 answer

Set custom error messages in Django 3 ModelForm in default pop-out window

I'm new in Django3 and now I got a task to create custom error-messages text in default pop-out window of ModelForm. This window: default pop-out window, when I press submit button Models.py class Application_form_model(models.Model): user_name =…
0
votes
1 answer

Why does the Django message tags boxs is not working?

I have a problems with the message tags. So I have a little apps that send a sms. When I press the submit button and my webpage, if the sms is send correctly a message.success is printed on the screen.(The success messages work fine. the text and…
tiberhockey
  • 576
  • 5
  • 22
0
votes
1 answer

I can't displaying error messages on Django Authentication forms

I am having issues trying to displaying error messages on different authentication forms On password reset form: What I am trying to achieve is to display error message like "Email not in our database" when a user enters unregistered email. on…
kennyb
  • 11
  • 4
0
votes
1 answer

Django building a user-to-user messaging system

I'm trying to build a messaging system for my website using Django but I don't know how to do. What I want is a system that enables a user to send a message to another user, with an inbox to see the received messages and notifications that warn the…
Julien Mertz
  • 465
  • 2
  • 8
  • 22
0
votes
2 answers

Remove messages before the response is rendered

I've got a page which contains 2 forms & allows updating of the model attached to each. I've also got the messages framework integrated which for the most part is perfect. But after posting to this page you get two messages of success and I'd like…
markwalker_
  • 12,078
  • 7
  • 62
  • 99
0
votes
1 answer

Can't dismiss message from SuccessMessageMixin in UpdateView

Update: Problem was more wide ranging in that no JS was working - see my own answer below. I have an UpdateView where I am using the SuccessMessageMixin to display an "updated" message. This works fine, but I can't seem to dismiss the message -…
michjnich
  • 2,796
  • 3
  • 15
  • 31
0
votes
1 answer

Django Messages are loading only after refresh after ajax call to delete a product from wishlist

In my django oscar project i have a wishlist templte which contains button to delete product from wishlist. The product is getting deleted after ajax call but the success message which is created in deleteview is loading after refreshing page.
Optimus
  • 1
  • 3
0
votes
1 answer

How do I implement a toaster message on success function of ajax in django?

I am working on a problem where I have to delete entries from the list. I need tp display a toaster message when item is deleted and I want to remove the deleted element without refreshing? How am I supposed to do it? I have tried a lot of links on…
Srvastav4
  • 177
  • 2
  • 12
0
votes
1 answer

How do I greet the user when they log into my website?

I'm trying to greet the user when they log into my django website, but using the django login has made it too difficult to send a message to my template and redirect to the new url behind the scenes. How can I greet the user(preferrably with that…
0
votes
0 answers

A list as a message is converted to a string

I pass a list into a message using the django message framework. When it is rendered in the template, I try to access the list using {{ item.0 }} for example, but nothing is coming through. If I just use {{ item }}, I can see my list. In short, I…
carl
  • 359
  • 2
  • 10
0
votes
1 answer

ImportError: cannot import name 'Message' - django-messages

I forked https://github.com/arneb/django-messages/ and put it in my repo: https://github.com/mike-johnson-jr/django-messages/ As I am using the package, I get the error in the title. Full traceback: Traceback (most recent call last): File…
Mike Johnson Jr
  • 776
  • 1
  • 13
  • 32
0
votes
0 answers

Adding messages without text in Django's messages framework

Sometimes I would like to trigger a message to the user with the message's text defined in the client-side JS code. I am using the message framework's tags to differentiate between the different messages in JS. Unfortunately, it seems to me that…
zepp133
  • 1,542
  • 2
  • 19
  • 23
0
votes
0 answers

Send alert message(data) from one login user session to another

I have a use case where a user (manager) creates a task (1st view) and another logged in user (employee) can view the task created (2nd view). If the employee rejects the task clicking reject button, an alert should notify the manager. How do I…
0
votes
0 answers

How can I directly access an instance of a django message via django template?

As a part of my error response I am trying to add "show" to a collapsable container using something like: class="{{request.session.registration}}" but instead of session use django messages so the "show" does not persist. Right now I'm using a…
Val14720
  • 45
  • 10
0
votes
1 answer

Implementation of django-directmessages application

I am trying to use django-directmessages app. It's an application to manage simple direct messages. A part of the Documentation says: Import the Message Management API on top of your views.py from directmessages.apps import Inbox Send message:…
Riwaj Chalise
  • 637
  • 1
  • 13
  • 27