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

Can't install django_messages app

I tried to install django_messages I copied the folder in my directory and ran this command: python manage.py makemigrations The error is this: C:\Users\Admin\Desktop\sample\enginesearch1>python manage.py runserver Performing system…
Uchiha AJ
  • 147
  • 3
  • 16
0
votes
0 answers

How to translate Django messages depending on the language selected

Hello I have a multy lingual project in Django. I have done the translations with USE_I18N. Everything works fine in the templates with the {% trans 'hello world' %} but how should I process the messages? when I send messages.warning(request,…
ThunderHorn
  • 1,975
  • 1
  • 20
  • 42
0
votes
1 answer

Django messages does not work

I am trying to use both django messages and bootstrap together. I also checked this question; django messages not showing However, I already applied what is written there. My settings.py; from django.contrib.messages import constants as messages #…
Hektor
  • 105
  • 3
  • 14
0
votes
1 answer

Django messages success message with data from submitted form

I've got Messages up and running; I can get a simple "submission successful" message to work so I know the context_processors and middleware are all configured properly. However, I'm trying to dynamically update the success message with data…
Mandelliant
  • 36
  • 1
  • 6
0
votes
0 answers

django success messages printed in admin site rather than pages

After a version upgrade from 1.11.1 to 1.11.4 success messages are not displayed in pages but in admin site. what has to be changed... messages.success(request, 'denetim başarıyla kaydedildi......') #return render(request,…
Levent E.
  • 31
  • 1
  • 5
0
votes
1 answer

Bootstrap alert closing on page load

I have a view in which I send some messages, like this: messages.warning(request, 'Nothing found") In my settings.py I have edited the message tags like: MESSAGE_TAGS = { messages.DEBUG: 'alert-info', messages.INFO: 'alert-info', …
Onilol
  • 1,315
  • 16
  • 41
0
votes
1 answer

Django messages: how to change html structure?

So I've got some really specific styling constraints for the messages, and I've pushed ::before and ::after as far as they will go. Beyond that what I really need is for the text of the message to be enclosed in a span tag, ideally with a settable…
Katharine Osborne
  • 6,571
  • 6
  • 32
  • 61
0
votes
2 answers

How to show PasswordResetForm errors in Django messages

I have the following view for my page to reset your password: from django.contrib.auth.forms import PasswordChangeForm def password_change(request): if request.method == 'POST': password_form = PasswordChangeForm(data=request.POST,…
cbuch1800
  • 923
  • 3
  • 11
  • 26
0
votes
0 answers

Success message not displayed in Django ClassBasedView

I am trying to display success message after saving form. I am using message framework for this settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', …
singhakash
  • 7,891
  • 6
  • 31
  • 65
0
votes
1 answer

Django: Messages not being displayed

I have following function for bulk operation of the selected rows in a ListView. I am showing messages for success and error. def archive_stores(view, queryset): if queryset.exists(): queryset.update(archive=True) …
0
votes
1 answer

How is REQUEST object for a user in Django Views diffrentiated from one to another?

I'm not sure if what I'm doing is right or wrong. But this functionality brought me across a very esoteric event happening inside Django Views. So the code: from django.contrib.messages import get_messages from django.contrib import messages #Other…
Shivam Sharma
  • 901
  • 1
  • 6
  • 12
0
votes
1 answer

Is it bad to pass my entire `request` object to my `Models.py` for validations in Django when using django-messages?

Having trouble finding a totally clear answer to this question. In my learning, I was taught to not pass along the entire request object when trying to pass data from views.py to models.py (when using a django manager). However, in my current…
twknab
  • 1,741
  • 1
  • 21
  • 35
0
votes
1 answer

Display message after HttpResponseRedirect in Django Class Based View

Either I'm not getting enough sleep or I'm missed something obvious. No matter what I do, I can't get messages to display from a class based view after a HttpResponseRedirect. Here's my view: class Add(SuccessMessageMixin, LoginRequiredMixin,…
Dave Merwin
  • 1,382
  • 2
  • 22
  • 44
0
votes
0 answers

LookupError: No installed app with label 'django_messages'

I am trying to use https://github.com/arneb/django-messages and followed instructions as below pip install django-messages INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', …
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313
0
votes
0 answers

How to automatically generate notification to user when events is added?

I have developed a website having functionality such as writing,posting ,user profiles, events & activities, offers..etc.I need to add one more functionality and i.e. Automatic push notification to the users about activities & events, offers and…