[Django] Setup virtual enviroment

[Django] Setup virtual enviroment

Goal

  • How to setup Python virtual environment


Intro

  • I had a plan to deploy my Django project on server
  • However, there were already a lot of Python programs
  • So, I wanted to make a special python environment containing packages which will be used in only my project


Practice

1. Install venv

  • venv : the module used to create and manage virtual environments
# apt-get install python3-venv

screenshot001


2. Setup virtual environment

2.1. Create virtual

$ python3 -m venv [VENV_DIRECTORY]

screenshot002

2.2. Activate virtual environment

$ source [VENV_DIRECTORY/bin/activate

screenshot003


screenshot004

screenshot005

screenshot006



References

댓글남기기

-->