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
1
vote
1 answer

Message Framework - Remove duplicate message

I have the following code: {% for message in messages %}
{{ message }}
{% endfor %} There are situations when the same message is repeated multiple times. How can I make the messages to be unique ?
user3541631
  • 3,686
  • 8
  • 48
  • 115
1
vote
2 answers

Django - Custom name of a flash message

I'd like to flash a message in a template, which there is a ton of information on, but I haven't seen any way to give it a custom name, which would allow it to have the appropriate class or id for styling. In Laravel: webpage.php @if…
Tunn
  • 1,506
  • 16
  • 25
1
vote
0 answers

Django messages are not shown if chrome data saver is enabled

Google data saver compresses data to reduce traffic usage. It is enabled by default in mobile (android) chrome and might be used in desktop chrome as plugin. Whe GDS is on django messages are NOT displayed. I created a sample application (Python…
1
vote
1 answer

django not loading app templates

I've look over the other SO questions related to this but none have helped. I just installed an app and added to the INSTALLED_APPS variable in settings. The app django_messages, extends a base.html template from each of its templates. For some…
hurlbz
  • 383
  • 3
  • 16
1
vote
0 answers

How to link Direct Messaging to recipient?

I am a complete Python/Django beginner, trying to compose a direct message to a recipient. I currently have a page for each user profile, with a link to "Send a message!" on their page. Ideally, once clicking on this link, it would allow you to…
pynewbee
  • 665
  • 3
  • 9
  • 19
1
vote
1 answer

Django 1.8: Is there a User-to-User messaging app that works both via the website and email?

I'm looking for a way for users to message each other via the website, with their own inbox, sent, etc folders, and to receive and reply to these messages via email as well. The email addresses used for replying are generated by the app to hide…
StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
1
vote
2 answers

TemplateNotFound after installing django-messages and django-postman

I get a TemplateNotFound after I installed django-postman and django-messages. I obviously installed them separately - first django-postman, and then django-messages. This is so simple and yet I've spent hours trying to resolve this. I'm using…
Charles Sounder
  • 591
  • 2
  • 5
  • 16
1
vote
2 answers

Delayed display of message from within an inclusion tag

The following problem is occurring in a large django project. I've been able to replicate the issue in a small mock-up project (code below). I am trying to use the django messaging framework within an inclusion tag to display a message when a…
Bosco
  • 935
  • 10
  • 18
1
vote
1 answer

Django Cannot assign "u'username'": "Message.recipient" must be a "User" instance

why I'm getting this error? I don't know how to get rid of this error. How can i clean the form field to enable the username to be validated? Thanks in advance. class InboxCompany(generic.UpdateView): model = CandidateToJob template_name =…
Ronaldo Bahia
  • 576
  • 3
  • 24
1
vote
1 answer

Django 1.6 - Messages not showing

Im trying to get the message framework in django to work. Here is the interesting bits of my settings.py INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', ) MIDDLEWARE_CLASSES = ( …
Tomas Jacobsen
  • 2,368
  • 6
  • 37
  • 81
1
vote
0 answers

Randomly adding messages to the Django messages framework

In a Django project I have a space in the templates to show the messages coming from the Django messages framework. I would like to use that framework to show some messages that are not triggered by user actions in some views but instead are set by…
Bastian
  • 5,625
  • 10
  • 44
  • 68
1
vote
1 answer

Custom error message from post_save signal

Ok so Im saving a CSV document to a Machine object. I want to notifiy the user that the Machine does not exist if it does not exist and exit the save. I first read the CSV file to see what machine the document is for by reading a serial number…
Harry
  • 13,091
  • 29
  • 107
  • 167
1
vote
0 answers

django.contrib.messages.middleware.MessageMiddleware bug

This is working before but now it gives me an error. I use built-in messages to show error, info, or success message. When the importing of data failed the system must execute message.error but it create an error. Exception: Types: …
catherine
  • 22,492
  • 12
  • 61
  • 85
0
votes
1 answer

Having problems with message tags

I am trying to create dynamic messages depending on user input but no alert button even appears. However when I get rid of {% for message in messages%} an empty alert button appears. views.py: from django.shortcuts import render, redirect from…
0
votes
1 answer

Is there a special way of adding Django message to current template with multiple forms and calls to same page?

I have a message template: messages.html {% if messages %}
    {% for message in messages %} {% if message.level ==…