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
3
votes
1 answer

Django Messages, How to Hide Specific Ones

I am using Django's messages framework to indicate successful actions and failed actions. How can I exclude account sign in and sign out messages? Currently, landing on a page after signing in displays Successfully signed in as 'username'. I do…
Tyler Bell
  • 837
  • 10
  • 30
3
votes
2 answers

How to write a Django message into your views code

I'm reading the documentation on how to display a message to the user with Django messages. It says that in order to add a message in your views to call: from django.contrib import messages messages.add_message(request, messages.INFO, 'Hello…
Amon
  • 2,725
  • 5
  • 30
  • 52
3
votes
2 answers

How to send Json or "dict" using Django Messages Framework

I'm using Django Messaging framework to send additional data on the validation error: def clean_X(self): xuser_id = self.cleaned_data['xuser_id'] if xuser.objects.filter(xuser_id=xuser_id).exists(): available_now =…
Satish V Madala
  • 182
  • 2
  • 12
3
votes
1 answer

Issue after django messages framework disabled

I'm trying to disable the django messages framework in django 1.8, so i did what docs says: If you don’t want to use messages, you can remove 'django.contrib.messages' from your INSTALLED_APPS, the MessageMiddleware line from…
Yuri Heupa
  • 1,198
  • 3
  • 10
  • 35
3
votes
0 answers

Popup window not displaying Django messages

I have a Django website that displays different gantt charts based on user selections. I have a bunch of Django's logging messages in my code and want to be able to set and then display in a popup window once the user hits a submit button, but I…
kdubs
  • 936
  • 3
  • 22
  • 45
3
votes
4 answers

Django messages framework with built-in Jinja2 backend

How can I use the Django messages framework with Jinja2 and the built-in Jinja2 backend in Django 1.8? I tried doing it as before, but then remembered that the Jinja2 backend doesn't have the context processors of Django Templating Language. Is it…
3
votes
1 answer

Django Messaging Framework not displaying message despite RequestContext

here's a conundrum for you, Using Django 1.4, I cannot get messages set through the messages middleware to display in my templates. I have combed through the Django docs and ensured that my settings.py file referenced the relevant apps,…
2
votes
2 answers

Show message in Django without needing a request

I have a view which uses threading e.g from .utils import my_heavy_function def my_view(request): if request.method == "POST": form = my_model_form() if form.is_valid(): #create thread thr =…
CutePoison
  • 4,679
  • 5
  • 28
  • 63
2
votes
5 answers

Error message not working as expected in Django

I am trying to display a message on order creation success or failure. For messages.success(request, "My message") it is working as expected. But for messages.error(request, "My message") it is not as expected. I read the django messages framework…
Sanjay
  • 33
  • 1
  • 7
2
votes
2 answers

Django admin change error message ("Please correct the errors below.")

Is it possible to change django admin error message. i want add my custom error message. Please correct the errors below. change this message class mymodel(admin.ModelAdmin): # change message
rahul.m
  • 5,572
  • 3
  • 23
  • 50
2
votes
2 answers

Django Postman implementation for sending messages

I am trying to use the Django-Postman framework to send messages between users in Django 2.0. I have installed the app and made the necessary changes as mentioned in the docs of the framework. However when i try to go the the message urls I get a…
Riwaj Chalise
  • 637
  • 1
  • 13
  • 27
2
votes
0 answers

Django show a message until user takes an action upon the message

I would like to display a dashboard notification in the view until user prefers to close it. It should stay there every time the user logs in. But if he clicks the close button on the notification, then the notification shouldn't be shown…
2
votes
1 answer

RuntimeError: Model class django_messages.models.Message doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

I am trying to use https://github.com/arneb/django-messages package for my messaging stuff and tried the following pip install git+https://github.com/arneb/django-messages.git INSTALLED_APPS = [ 'django.contrib.admin', …
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313
2
votes
3 answers

Delete all django.contrib.messages

I recently realized that a module in our Django web app was using django.contrib.messages. However, the template's context processor did not have the django.contrib.messages.context_processors.messages processor added. I'm worried that when I push…
Jedi
  • 3,088
  • 2
  • 28
  • 47
2
votes
1 answer

Django Messages suddenly not working

Django messages app is suddenly showing following error: AttributeError at /user_logout/ 'function' object has no attribute 'add_message' Request Method: GET Request URL: http://127.0.0.1:8080/user_logout/ Django Version: …
Jatinder
  • 51
  • 1
  • 1
  • 9
1
2
3
10 11