We need to load various configuration parameters in our Python WSGI application according to production or debugging environments (in particular, server configuration information related to the task server to which the application should send tasks). So far, we have implemented the global debug variable, which is set in our deployment script - this correctly changes the deployment setting. However, when running the application, we need to set the debugging variable True - since its default value is False .
It is still difficult to correctly determine how the debugging variable works, since it is set during deployment, and not for execution time. We can set it before calling the serve_forever method of our debug WSGI server, but I donβt know about the consequences of this and how good this solution is.
What is the usual pattern for separating debugging and production environments in WSGI applications? If I need to pass it in system arguments, or if there is another, different way, please let me know. Thank you very much!
source share