Created a test application in the Python framework Flask. The application is launched via the Apache web server mod_wsgi. The application reacts poorly to changes in the source code, showing me old versions of the pages. At the same time, each time is different (2.3 code changes back). It shows the current version only after restarting Apache. Flask debug mode is enabled. What else could be the problem?

    2 answers 2

    It is better to configure uWSGI, then you can enable the python-autoreload = 1 option in uwsgi.ini . We use it exactly this way, it works reliably. From mod_wsgi and Apache was eventually abandoned in favor of nginx + uWSGI.

    By the way, the flage debug mode is absolutely useless on the combat server, if the top is a stack of nginks and uWSGI. With the processing of exceptions, if there is a syntax error, this is also a problem. Therefore, for debugging - only dev server. It is for this and need, in general. Or just have not yet learned how to handle error 500 handler.

      mod_wsgi has 2 modes of operation: "embedded mode" and "daemon mode". In the first case, to apply changes to the source code, a full server reboot is required. To automatically apply changes, the module must be run as "daemon mode". Read more