If it is a Django-related parameter, having set it in local_settings.py should not set the environment variable and causing plots to be generated outside of the webui, as it is now. If we convert it into an openquake.cfg parameter it would cause the plots to be generated always, which is probably not what we want, but at least it would not be confusing.
Perhaps the solution is to set OQ_APPLICATION_MODE inside LoginRequiredMiddleware.
If it is a Django-related parameter, having set it in local_settings.py should not set the environment variable and causing plots to be generated outside of the webui, as it is now. If we convert it into an openquake.cfg parameter it would cause the plots to be generated always, which is probably not what we want, but at least it would not be confusing. Perhaps the solution is to set OQ_APPLICATION_MODE inside LoginRequiredMiddleware.