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

How to create a conversation list in Django chatting app

I am trying to add messaging functionality to my web app made in Django. So far, I have managed to successfully send and receive messages from user to user. But, now I have been stuck at showing all the conversation lists to the inbox.html page of…
0
votes
1 answer

How do i properly show a flash message in django

I have this view function that needs to send a flash message to a user when they sign up. Now that is running well but the problem is that I set an error message to show when the username or password is incorrect and its always showing there by…
0
votes
1 answer

How to restrict a custom validator to only pushing errors to field.errors and not django messages?

I am using a custom validator on a model field. Model field: html_content = models.TextField(blank=True, verbose_name=_("HTML content"), …
alias51
  • 8,178
  • 22
  • 94
  • 166
0
votes
0 answers

Django messages not showing in template

stuck with messages don't show up cant figure whats wrong with my code def studentreg(request): if request.method == 'POST': form = StudentRegisterForm(request.POST) if form.is_valid(): form.save() …
cipher
  • 373
  • 7
  • 20
0
votes
1 answer

Django messages not showing up on redirects, only render

For a couple days now, I've been trying to figure out why my messages don't show up on redirects. All of the dependencies are there in my settings.py file as you can see. I don't think that's the problem because I am getting two messages to show up…
JackJack
  • 181
  • 1
  • 1
  • 20
0
votes
1 answer

Django messages not rendering properly

I am making a project in Django and want to render a styled message if a user fails to input their username/password correctly. The message does render, but it doesn't render using the CSS provided for it: ul.messages li.error{ …
J. N
  • 11
  • 1
0
votes
1 answer

Django-messages works only when form|crispy is used but not in other cases

I am creating a login page using django but it does not show any messages when I enter wrong passwords or email addresses. I've also checked other messages but it didn't help. login.html

Login

{% if…
Saatwik
  • 19
  • 5
0
votes
1 answer

How To Change A Third Party App's Models.py Due To Invalid Import

I'm trying to add django-messages to my app but I'm getting this error when I add it to my installed apps ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'…
horse
  • 479
  • 7
  • 25
0
votes
2 answers

Django messages not showing up on contact form template

I have a contact form on my Django Site. I am attempting to have a message box popup when the user clicks to submit their message. For some reason, I cannot get the message I am creating to display. I have looked everywhere but cannot seem to…
0
votes
1 answer

Django - Messages functionality not working in Class based view

Unable to display messages in class based view. In another app's views.py, it is working fine where I used function based view. views.py: class PostDeleteView(LoginRequiredMixin, UserPassesTestMixin, SuccessMessageMixin, DeleteView): model =…
Gokul nath
  • 494
  • 2
  • 8
  • 17
0
votes
1 answer

render() got an unexpected keyword argument 'renderer'

I'm trying to use django-messages to enable user to user messaging on my website. when I'm setting it up, I encountered this error when I'm trying to access the compose page. TypeError at /messages/compose/ render() got an unexpected keyword…
chip
  • 3,039
  • 5
  • 35
  • 59
0
votes
1 answer

Django messages: how can i change message text in html?

View: messages.add_message(request, messages.ERROR, 'Cells marked incorrectly.') HTML: {% if messages %}
    {% for message in messages %}
  • {{ message }} …
0
votes
0 answers

Django message variable not available in If.. statement

I am trying to use the Django message system to send the user back to their previous page. I have a Delete Customer FBV that can be accessed from multiple locations and after deleting the customer I want to send the user back to where they were. If…
0
votes
1 answer

Django messages not working in admin model_save()

I have the following save_model in MyModelAdmin, the print statement gives output in console, but on django admin, i can see default messages, but not my error message for some reason. class MyModelAdmin(admin.ModelAdmin): def save_model(self,…
suneet
  • 400
  • 1
  • 5
  • 19
0
votes
1 answer

Message on logout

I'm wanting to display a message to the user after they are logout and are redirected to the homepage. I know this likely doesn't work because I am trying to display the message before returning a redirect to the homepage. views.py def…
GTA.sprx
  • 817
  • 1
  • 8
  • 24