Django Virtual Environment Setup
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
You must login to ask question.
Without virtual environments, all your projects will use the same installed packages.
When you want to move a project to a server when it’s done, you don’t know which packages are needed for this project, so your only option is to also install all of those packages there. It will quickly become a long list and many of the packages won’t be necessary for that particular project.
When using a virtual environment, you have a set of installed packages for each project, and they don’t mix. Much nicer.
You can start using virtual env now. In your project directory, do:
Now you have the virtualenv command (for all projects).
Now you have a directory “env” in your project directory that will contain this project’s virtualenv.
Now you are using this virtualenv (your prompt changed to reflect that).
Installs Django only for this project.
Shows you which packages are installed, now only for this project.
Creates a requirements.txt that you can use to remember which packages need installing, and as input for