diff --git a/docs/deploying/mod_wsgi.rst b/docs/deploying/mod_wsgi.rst index 41b82c2b..c1ce170a 100644 --- a/docs/deploying/mod_wsgi.rst +++ b/docs/deploying/mod_wsgi.rst @@ -193,5 +193,11 @@ Add the following lines to the top of your ``.wsgi`` file:: activate_this = '/path/to/env/bin/activate_this.py' execfile(activate_this, dict(__file__=activate_this)) +For Python 3 add the following lines to the top of your ``.wsgi`` file:: + + activate_this = '/path/to/env/bin/activate_this.py' + with open(activate_this) as file_: + exec(file_.read(), dict(__file__=activate_this)) + This sets up the load paths according to the settings of the virtual environment. Keep in mind that the path has to be absolute.