Answer the question
In order to leave comments, you need to log in
How to start web development with python/django?
As far as I understand, for each application (django / flask) you need to create a separate environment? Are there situations where you can create one environment for several, for example, with identical packages, applications?
When running a web application on an apache2+mod-wsgi server, how does it work and recognize virtual environments?
#apache2 virtualhost:
#...
WSGIScriptAlias / var/www/mydomain.com/index.wsgi
#index.wsgi:
#...
activate_env=os.path.expanduser("~/.virtualenvs/myprojectenv/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
Answer the question
In order to leave comments, you need to log in
1. It is considered good practice to create a virtualenv for each project. There are no obvious disadvantages here, unlike a different approach, and the matter is simple. ;-) Applications, of course, can use identical packages, but you need to think in the future.
2. It is this line that tells the module which environment to use:
activate_env=os.path.expanduser("~/.virtualenvs/myprojectenv/bin/activate_this.py")
To the first question - anyway, then it will come out that the applications use different packages (the bug was fixed on one, they didn’t reach the second hand, for example) and you will have to make separate ones. So make it separate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question