Django messages are not shown if chrome data saver is enabled.

42 views
Skip to first unread message

Vitaly Trifanov

unread,
Sep 25, 2017, 7:53:25 AM9/25/17
to Django users
Intro: Google data saver is a chrome plugin that compresses data toreduce traffic usage. It is enabled by default in mobile (android) chrome and might be used in desktop chrome also.

Environment: Python 3.5, Django 1.10.8/1.11.5 (reproducible on both), uwsgi+nginx. 

Application: simple app with one "submit" button on main page that triggers the view method:

def welcome_view(request):
    if request.method == 'POST':
        messages.add_message(request, messages.INFO, "succeed")
        return HttpResponseRedirect('/')
    else:
        return render(request, 'index.html')

Full app attached in zip file (12 KB).

Deployed application available at fqtest.ru

Steps to reproduce:
1. Deploy to some server (or use mine fqtest.ru). Don't forget to specify allowed hosts in settigs.py. 
2. Turn off chrome data saver plugin if you have it or use launch ingognito mode.
3. Open main page and click Go bitton. Result: message shown as expected
4. Turn on data saver plugin or install it
5. Open main page and click Go bitton. Result: message NOT shown while it should be.

Severity: high. Anyone who uses app from android phone will see no messages at all.

Questions:
  • What are reasons of this behavior?
  • How can it be fixed/worked around?
Hope for help. Thanks!
djangotest.zip
Reply all
Reply to author
Forward
0 new messages