#1 ENVIRONMENT SETUP - WONILLISM/Clone_airbnb GitHub Wiki

created by wopark

m1 ๋งฅ brew ์„ค์น˜

# We'll be installing Homebrew in the /opt directory.
 cd /opt

 # Create a directory for Homebrew. This requires root permissions.
 sudo mkdir homebrew

 # Make us the owner of the directory so that we no longer require root permissions.
 sudo chown -R $(whoami) /opt/homebrew

 # Download and unzip Homebrew. This command can be found at https://docs.brew.sh/Installation.
 curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

 # Add the Homebrew bin directory to the PATH. If you don't use zsh, you'll need to do this yourself.
 echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
  • ํ„ฐ๋ฏธ๋„ ์žฌ์‹คํ–‰
  • brew update

python ๋ฒ„์ „ ๊ด€๋ฆฌ

python์€ 2.x๋ฒ„์ „๊ณผ 3.x๋ฒ„์ „์ด ๋งŽ์ด๋‹ค๋ฅด๊ณ , ์š”์ฆ˜์€ 3.x๋ฒ„์ „์„ ๋งŽ์ด ์‚ฌ์šฉํ•˜์ง€๋งŒ 3.x๋ฒ„์ „๋“ค๋ผ๋ฆฌ๋„ ์กฐ๊ธˆ์”ฉ ์ฐจ์ด๊ฐ€ ์žˆ๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ virtureenv๋ผ๋Š” ๊ฒƒ์ด ์žˆ๋Š”๋ฐ, ๊ฐ ํ”„๋กœ์ ํŠธ๋งˆ๋‹ค ์“ฐ์ผ ๊ฐ€์ƒํ™˜๊ฒฝ์„ ์ƒ์„ฑํ•˜์—ฌ ๊ทธ ํ”„๋กœ์ ํŠธ์— ํ•ด๋‹น๋˜๋Š” python ๋ฒ„์ „์„ ํ™œ์„ฑํ™” ํ•œ ํ›„์— ์‹คํ–‰์‹œํ‚จ๋‹ค.

pyenv๋ž€?

pyenv๋ž€ ์—ฌ๋Ÿฌ ๋ฒ„์ „์˜ python์„ ์‰ฝ๊ฒŒ ๋ฐ”๊ฟ”์„œ ์“ธ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๋„๊ตฌ์ด๋‹ค. pyenv๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ์จ python ๋ฒ„์ „์— ๋Œ€ํ•œ ์˜์กด์„ฑ์„ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค.

brew install pyenv

์„ค์น˜ ๊ฐ€๋Šฅํ•œ ๋ฒ„์ „ ๋ฆฌ์ŠคํŠธ pyenv install -list

ํŒŒ์ด์ฌ ๋ฒ„์ „ ์„ค์น˜ pyenv install [python-version]

ํŒŒ์ด์ฌ ๋ฒ„์ „ ์‚ญ์ œ pyenv uninstall [python-version]

ํŒŒ์ด์ฌ ๋ฒ„์ „ ์‚ฌ์šฉ(์ผ์‹œ์ ) pyenv local [python-version]

ํŒŒ์ด์ฌ ๋ฒ„์ „ ์‚ฌ์šฉ(์ „์—ญ์ ) pyenv global [python-version]

๋กœ์ปฌ์— ์„ค์น˜๋œ ํŒŒ์ด์ฌ์œผ๋กœ ๋˜๋Œ๋ฆฌ๊ธฐ pyenv global system

ํ˜„์žฌ ํŒŒ์ด์ฌ ๋ฒ„์ „ ํ™•์ธ pyenv version

pyenv๋กœ ์„ค์น˜๋œ ํŒŒ์ด์ฌ ๋ฒ„์ „ ๋ชฉ๋ก pyenv versions

  • zsh ์‚ฌ์šฉ์‹œ ์„ค์ •
    • echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
    • echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zprofile
    • echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zprofile
    • echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
    • echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  1. python version 3.7.11์‚ฌ์šฉ
  2. pipenv ์„ค์น˜.
    1. sudo python3 -m pip install --upgrade pip
    2. pip install pipenv
  3. pipenv shell์„ ์ด์šฉํ•ด์„œ ๊ฐ€์ƒํ™˜๊ฒฝ์„ ์ผ ๋‹ค.
  4. pipenv install Django==2.2.5
  5. django-admin์œผ๋กœ ์ž˜ ์„ค์น˜๋˜์—ˆ๋Š”์ง€ ํ™•์ธ.
    1. ๊ฐ€์ƒํ™˜๊ฒฝ์ด ์‹คํ–‰๋˜์ง€ ์•Š์€ ์‰˜์—์„œ๋Š” ์žฅ๊ณ ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†๋‹ค.
  6. exit๋กœ ๊ฐ€์ƒํ™˜๊ฒฝ์„ ์ข…๋ฃŒํ•  ์ˆ˜ ์žˆ๋‹ค.

created by mki

#1.0 The Package Installer for Python (05:25)

  • pipenv

1 NodeJS, React๋ฅผ ์•„๋Š”์‚ฌ๋žŒ, npm

ํŒŒ์ด์ฌ์„ ๋ฐ›์œผ๋ฉด pip๊ฐ€ ๋”ธ๋ ค ์˜จ๋‹ค. npm๊ฐ™์€ ๊ฒƒ.

react
express
pip์€ ๋ชจ๋‘ global
pipenv๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•œ๋‹ค. npn package.json

2 ๋ชจ๋ฅด๋Š” ์‚ฌ๋žŒ

pip๋Š” ํŒจํ‚ค์ง€๋ฅผ ๋ฐ›๋Š” ์ˆ˜๋‹จ.

๋ˆ„๊ตฐ๊ฐ€ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์„ ์ˆ˜ ์žˆ์–ด์•ผ ํ•œ๋‹ค.

Package Installer for Python

pip install Django==2.2.5

globalํ•˜๊ฒŒ ์„ค์น˜ํ•˜๊ธฐ ์‹ซ๋‹ค.

Django 2.2์™€ Django3.0์„ ๋”ฐ๋กœ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค.

์›ํ•˜๋Š” ๊ฒƒ์€ ๋ฒ„๋ธ” ๊ฐ™์€ ๊ฒƒ!

๊ธ€๋กœ๋ฒŒ ์„ค์น˜๋Š” ์–ธ์ œ๋‚˜ ์•ˆ์ข‹๋‹ค!

#1.1 Meet Pipenv (02:55)

  • pipenv๋Š” ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์˜ ์ตœ๊ณ ๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค...?
  • ํŒŒ์ด์ฌ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €
  • pipenv๋Š” ์œˆ๋„์šฐ์—๋„ ์‹ ๊ฒฝ์ผ๋‹ค.
  • pip๋Š” ๋ชจ๋“  ๊ฒƒ์„ ๊ธ€๋กœ๋ฒŒ๋กœ ์„ค์น˜ํ•œ๋‹ค.
  • pipenv๋Š” ๋ฒ„๋ธ”์„ ์ƒ์„ฑํ•œ๋‹ค.
  • pipenv

pipenv ์„ค์น˜๋ฒ•

https://github.com/pypa/pipenv

https://pipenv.pypa.io/en/latest/install/#installing-pipenv

pip install --upgrade pip
pip install pipenv

or

brew install pipenv

#1.2 Creating our Env and Installing Django (06:56)

pipenv

mkdir airbnb-clone
cd airbnb-clone

pipenv --three
pipenv --python 3.7

code .

Pipfile

๋ฒ„๋ธ”์„ ๋งŒ๋“ค๊ธด ํ–ˆ์ง€๋งŒ ์•„์ง ๋ฐ–์— ์žˆ๋‹ค.
๋ฒ„๋ธ” ์•ˆ์œผ๋กœ ๋“ค์–ด๊ฐ€๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋ž˜ ๋ช…๋ น์„ ์ž…๋ ฅํ•˜์ž.
pipenv shell

pipenv install Django==2.2.5

2019 9์›”

๋ฒ„์ „์„ ๊ผญ ์ฐ์—์„œ ์„ค์น˜ํ•˜์ž
์ด๋ฒˆ ์˜์ƒ์€ ๋ฒ„๋ธ”์„ ์„ค๋ช…ํ•˜๊ณ  ๋“ค์–ด๊ฐ€๋Š”๊ฒŒ ๋ชฉํ‘œ์˜€๋‹ค

django-admin

#1.3 Creating the Github Repository (03:55)

repository airbnb-clone

์„ค๋ช…๋ž€. Cloning Airbnb using Python, Django, Tailwind and more...

git init
git remote origin 
git add .
git commit -m "fff"
touch README.md
touch .gitignore

#README.md

# Airbnb Clone

Cloning Airbnb with Python, Django, Tailwind and more... 

# .gitignore

https://www.toptal.com/developers/gitignore
python django

# Mac

.DS_Store

#1.4 Testing the Bubble (02:36)

๋ฒ„๋ธ”์ด ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€...

์ƒˆ ํƒญ์„ ์—ด๊ณ 

django-admin

comand not found๊ฐ€ ๋œฌ๋‹ค.

pipenv shell๋กœ ๋Œ์•„๊ฐ€๋ฉด...

django-admin์ด ๋™์ž‘ํ•œ๋‹ค.

๋ฒ„๋ธ”์˜ ์•ˆ๊ณผ ๋ฐ”๊นฅ์˜ ์ฐจ์ด

pipenv shell๋ถ€ํ„ฐ ์‹คํ–‰ํ•ด์•ผ ํ•œ๋‹ค!

์–ธ์ œ๋‚˜ pipenv shell

which django-admin

pipenv shell
django-admin
ํ•ญ์ƒ ํ™•์ธ