Wikimedia

Flask-JSONLocale: Bypass cache when DEBUG=True

Flask-JSONLocale library is used to localize Flask-based apps. Its users include Watch Translations or Commons Mass Description.

Problem

flask-jsonlocale library currently caches its messages in a huge _messages variable that never gets refreshed. That's acceptable at most production environment, given when code is deployed, whole webservice needs to be restarted, however, it's not usable when the app is developped locally - each time you add a message, you need to restart your devserver to see the results.

Proposed solution

Bypass cache when DEBUG=True.

Student is expected to provide a GitHub pull request against https://github.com/urbanecm/flask-jsonlocale.

Task tags

  • python
  • flask
  • library

Students who completed this task

taavi

Task type

  • code Code
close

2019