Where in a virtualenv does the custom code go?

后端 未结 4 1439
情深已故
情深已故 2020-12-07 07:42

What sort of directory structure should one follow when using virtualenv? For instance, if I were building a WSGI application and created a virtualenv called

4条回答
  •  独厮守ぢ
    2020-12-07 08:13

    virtualenv provides a python interpreter instance, not an application instance. You wouldn't normally create your application files within the directories containing a system's default Python, likewise there's no requirement to locate your application within a virtualenv directory.

    For example, you might have a project where you have multiple applications using the same virtualenv. Or, you may be testing an application with a virtualenv that will later be deployed with a system Python. Or, you may be packaging up a standalone app where it might make sense to have the virtualenv directory located somewhere within the app directory itself.

    So, in general, I don't think there is one right answer to the question. And, a good thing about virtualenv is that it supports many different use cases: there doesn't need to be one right way.

提交回复
热议问题