KeithC
KeithC

Reputation: 456

Virtualenv for Django dev, better to be at Project or App level?

With Django, Is it better to have a virtualenv created at project level.

Or,

is it better to have a virtualenv per app within a single project?

Upvotes: 1

Views: 73

Answers (1)

little_birdie
little_birdie

Reputation: 5857

All the apps installed (INSTALLED_APPS) within a single project run under the same python process, so it's going to be one virtualenv for all apps.

If you have an app that requires a specific python environment and the others really aren't able to run in that environment (for example, if one app requires python3 and another requires python2), then you would have to run the problem app in its own Django application server instance.

Since normally you would have nginx or Apache in front of your Django instance, you could have multiple Django instances appear to be one server. But it's a situation you'd want to avoid.

Upvotes: 5

Related Questions