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 get all user in django template without using views.py?

I have an existing project that has no views.py and models.py.It has a user login system.I want to get the list of all user in the template.I have searched more but found no solution.
0
votes
1 answer

Django: How can I remove all stored messages?

I used django message framework only in one view(PasswordChangeView). Problem is that when I access to PasswordChangeView, this page shows all message in message storage such as Login successed, Logout success etc... This is my template.html: {% for…
user3595632
  • 5,380
  • 10
  • 55
  • 111
0
votes
1 answer

Django refresh session to obtain any new messages for user

I'm trying to do a simple push protocol for django messages. So in my REST call, I have the following snippet: storage = get_messages(self.request) res = dict(messages=[dict(level=item.level, message=item.message) for item in storage]) …
velis
  • 8,747
  • 4
  • 44
  • 64
0
votes
2 answers

Making django's messages appear in Javascript alert rather than html?

I'm trying to display messages to the user when they login/signup using the alert function of javascript. I'm trying something like this, but it doesn't seem to work. What is the correct syntax to pass django's variables to the script in a…
Dr Confuse
  • 605
  • 1
  • 7
  • 24
0
votes
1 answer

Django messages framework not displaying message?

I'm trying to build a community portal and am working on displaying one-time message to the user such as "login successful" and the like; and am working with Django's messages framework. My template has the following line which currently does…
0
votes
1 answer

How can I set success_mesasge with format() in django generic view?

What I want to implement is like this : from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.views.generic import CreateView from posts.models import Post class…
user3595632
  • 5,380
  • 10
  • 55
  • 111
0
votes
1 answer

Python 3 - Django 1.9 persistent messages

Is there some app which behaves the same as native Django messages framework, but can store messages/notifications permanently and to specific user (instead of storing them temporarily for the current session/user)? I searched over the Internet and…
softzer0
  • 445
  • 2
  • 7
  • 25
0
votes
3 answers

Show errors in login form

I've created a user login page, and it works great! But when the user inputs the wrong credentials, how can I show an error on the login page? I tried usign an if and a variable, but that resulted in the error being shown no matter what. In my…
Sebastian Olsen
  • 10,318
  • 9
  • 46
  • 91
0
votes
1 answer

Django how to pass message in return redirect?

I want to pass a 'success' message to the post, after a new comment is added. Here are the views: @login_required def add_comment(request, post_slug): p= Article.objects.get(slug=post_slug) cform = CommentForm(request.POST) if…
Jand
  • 2,527
  • 12
  • 36
  • 66
0
votes
1 answer

Where to save messages in Django app?

I want to make my own on Django-app. The app must have an messages-application not only for notification but for chatting between users. So, for example I've write a model for messages, so where I have to save the messages? In the database, or maybe…
kozlone
  • 111
  • 8
0
votes
0 answers

URL pattern in message

After the register, I would like to display a message with a link inside. The link should go to the login form: membres.views.login. I've read something about reverse url but did not really understand it... And of course it does not…
Nicolas Lemoine
  • 341
  • 4
  • 18
0
votes
1 answer

Irrelevant Alert message before performing any image upload in django

i have been working on my image upload portion of my web app and developing it using Django.My Image Upload functionality working absolutely fine.No problem with that. But in my image upload page i am getting unnecessary alert message at a time such…
Md. Tanvir Raihan
  • 4,075
  • 9
  • 37
  • 70
0
votes
3 answers

Django admin: Using messages.error still results in confirmation being shown

I've overridden my save_model() function to wrap the obj.save() call in a try/catch. def save_model(self, request, obj, form, change): from concurrency.exceptions import RecordModifiedError from django.http import HttpResponse try: …
iank
  • 800
  • 3
  • 10
  • 32
0
votes
0 answers

Django messages faulty, but only on one particular network

I'm experiencing an issue with Django's messaging framework, but only on one specific network. Two users have reported the issue on their office network, but if they access the site via a different network (e.g. their home network), everything runs…
seddonym
  • 16,304
  • 6
  • 66
  • 71
0
votes
0 answers

Django auto fill recipient in Django_messages

I'm building a job board and I'm using django_messages for private messages. It works great but I want to auto fill the recipient form field with the username and I don't know why. Some thoughts? This is the view which I have candidates that applied…
Ronaldo Bahia
  • 576
  • 3
  • 24
1 2 3
10
11