简体   繁体   English

Django虚拟环境

[英]Django virtual environment

What is the proper way of adding an already existing Django project to a newly created virtual environment? 将已经存在的Django项目添加到新创建的虚拟环境中的正确方法是什么? Do I just move the project to the virtual environment root directory? 是否仅将项目移至虚拟环境根目录?

It doesn't matter where the directory is - the only important thing is that you activate the virtual environment every time you want to work on the project. 目录在哪里都没有关系-唯一重要的是,每次您要在项目上工作时,都激活虚拟环境。

I personally prefer to have the project directory inside the virtual env directory, but that is not required. 我个人更喜欢将项目目录放在虚拟env目录中,但这不是必需的。

One caveat: don't put the virtual env inside your project directory. 一个警告:不要将虚拟环境放入项目目录中。 That may cause problems with test discovery and with git. 这可能会导致测试发现和git问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM