I\'m using the Django Message Framework to show messages to users as well as the @login_required decorator on one of my views. So if a user tries to access a certai
I know it's old but it can still help others
I think to redirect an unconnected user to the login page and at the same time send a message you can proceed as follows:
from django.contrib import messages
def views(request):
if request.user.is_anonymous:
messages.add_message(request, messages.INFO,
'You must be logged in')
return redirect('your_login_views')
else:
# do smothing
return redirect(request, 'your_page.html')