Skip to content

Instantly share code, notes, and snippets.

@virbo
Last active February 19, 2020 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virbo/56ad97606cdfa8b30f52d3101790f664 to your computer and use it in GitHub Desktop.
Save virbo/56ad97606cdfa8b30f52d3101790f664 to your computer and use it in GitHub Desktop.
All about Django - Python2 - Python3

SETUP VIRTUAL ENV

pip install virtualenvwrapper

SETUP ENV PATH

nano .bash_profile

export PATH="/Users/yusufayuba/Library/Python/3.7/bin:$PATH"
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Python-Project
source /usr/local/bin/virtualenvwrapper.sh

Lokasi file virtualenvwrapper.sh di Python3 berada di /Users/yusufayuba/Library/Python/3.7/bin jadi harus diupdate PATH-nya

CREATE VIRTUAL ENVIRONTMENT

mkvirtualenv temp
workon

Contoh diatas akan membuat virtual env bernama temp

MENGAKTIFKAN VIRTUAL ENVIRONTMENT YANG SUDAH ADA (EXISTS)

workon $HOME/.virtualenvs/temp

Contoh diatas akan mengaktifkan kembali virtual env temp

INSTALL DJANGO (USING PYTHON3)

python3 -m pip install Django
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment