July 2019
Beginner to intermediate
302 pages
9h 38m
English
Follow these steps to deploy a Flask application using Apache:
activate_this = '<Path to virtualenv>/bin/activate_this.py' exec(open(activate_this).read(), dict(__file__=activate_this)) from my_app import app as application import sys, logging logging.basicConfig(stream = sys.stderr)
Since we perform all our installations inside virtualenv, we need to activate the environment before our application is loaded. In the case of system-wide installations, the first two statements aren't needed. Then, we need to import our app object as application, which is used as the application that's being served. The last two ...