Hey, just had a question about working with venvs in python web development.

So far Ive been working on my first site, its going good (except getting 
stuck on a CMS for my flask app).  Once Im about done Im going to build 
another 2 sites, which will probably use django, my next tutorial series to 
tackle.  So obviously I need to use venv to separate each site project's 
packages and stuff to prevent conflicts and problems.

Whats interesting is on ubuntu it appears there are 3 pythons in use.  
Default 2x, and 3x, with their packages here :  
/usr/lib/python2.7/dist-packages    /usr/lib/python3/dist-packages

and the python3 Im using is here, and has all the packages Im using for my 
current site: 

$ ls /usr/local/lib/python3.4/dist-packages

flask                    itsdangerous-0.24.egg-info            
passlib                         PyMySQL-0.7.2.dist-info    
WTForms-2.1.egg-info
Flask-0.10.1.egg-info          itsdangerous.py             
passlib-1.6.5.dist-info  werkzeug
flask_wtf                              jinja2                      
__pycache__                      Werkzeug-0.11.4.dist-info
Flask_WTF-0.12.egg-info   Jinja2-2.8.dist-info        
pymysql                        wtforms

Ive activated my venv and pip3 installed these packages yet when I open the 
venv folder within FlaskApp it shows no files in site-packages :  

/var/www/site1/FlaskApp/FlaskApp/venv/lib/python3.4/site-packages

as they are being installed to /usr/local/lib/python3.4/dist-packages - it 
seems with my current config the interpreter in venv serves no purpose as 
its not running the app. 

So I want to figure out how to keep future projects properly isolated, but 
still served up automatically when the server boots up, as its very 
convenient to configure once, set and forget.  Im a little lost on how to 
set up venvs properly as it seems when I configured mod wsgi it installed 
it to the default python3.  Maybe I can run a pip3 freeze on current 
python3.4 :

pip3 freeze
pip3 freeze > requirements.txt

then install these into a new project venv for a 2nd website employing 
another flaskapp:

pip3 install -r requirements.txt


I got a feeling Ill have to revamp this whole configuration and use 
standalone wsgi configs which is a hassle.  Any help is appreciated 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.

Reply via email to