Graham,
Great post. In my current set up, I have multiple flask python applications
hosted on multiple virtual hosts.
I have created only one virtual environment that all the applications use.
Outside of all the virtual hosts, I have:
##########################################
WSGISocketPrefix /var/run/wsgi
WSGIPythonHome /WebHA/catworld/featureanalytics-443S/webpython #folder of
my virtualenv
########################################
Then in each virtual host, I have among others:
#########################################
DocumentRoot "/WebHA/catworld/featureanalytics-443S/workforce_tool/"
ServerName wpat.cat.com
ServerAlias wpat.cat.com
WSGIDaemonProcess wpat.cat.com user=http group=http processes=4 threads=4
WSGIProcessGroup wpat.cat.com
WSGIPassAuthorization On
WSGIScriptAlias /
/WebHA/catworld/featureanalytics-443S/workforce_tool/workforce_tool.wsgi
Alias /static
/WebHA/catworld/featureanalytics-443S/workforce_tool/app/static
<Directory /WebHA/catworld/featureanalytics-443S/workforce_tool/app/static/>
Order allow,deny
Allow from all
</Directory>
#######################################
The corresponding wsgi file for the above virtual host is:
###############################################
#workforce_tool.wsgi
#!/WebHA/catworld/featureanalytics-443S/webpython/bin/python
activate_this =
'/WebHA/catworld/featureanalytics-443S/webpython/bin/activate_this.py'
exec(open(activate_this).read())
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/WebHA/catworld/featureanalytics-443S/workforce_tool/")
from app import theapp as application
application.secret_key = 'mykey'
#############################################
*Python 3.4.3 *
*mod_wsgi 4.4.22 *
*Daemon mode*
I followed a tutorial online to set things up this way.
For other reasons, I have to switch to use anaconda/conda distribution of
python. So I'll be creating conda environments for each app.
*1. How will the code in the wsgi file change especially about activating
the python environment? *
*2. How will my set up change to use a different conda environment for each
app/virtual host? I want to move away from using one environment for every
python app. *
Thanks
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.