๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • What would life be If we had no courage to attemp anything?
Development/Django

Django ํ™˜๊ฒฝ ํ™œ์„ฑํ™”

by DevIseo 2022. 3. 6.

 

Django ์‹œ์ž‘ํ•˜๊ธฐ

0. ์ƒ์„ฑ ๋ฐ ํ™œ์„ฑํ™” (git bash)

$ python -m venv [๊ฐ€์ƒํ™˜๊ฒฝ์ด๋ฆ„]
$ source [๊ฐ€์ƒํ™˜๊ฒฝ์ด๋ฆ„]/Scripts/activate
$ pip list
 

1. ๊ฐ€์ƒํ™˜๊ฒฝ ์ƒ์„ฑ ๋ฐ ํ™œ์„ฑํ™”

ctrl+shift+p - select interpreter venv์„ค์ •

$ pip install django==3.2.12
 

2. ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

$ django-admin startproject [ํ”„๋กœ์ ํŠธ ์ด๋ฆ„] .
 

3. Django์„œ๋ฒ„ ์‹œ์ž‘ํ•˜๊ธฐ(ํ™œ์„ฑํ™”)

ls๋กœ manage.py์žˆ๋‚˜ ํ™•์ธํ•˜๊ณ  ํ•˜๊ธฐ!

$ python manage.py runserver
 

4. ๋ฉ”์ธ ํŽ˜์ด์ง€ ๋กœ์ผ“ ํ™•์ธ

5. Application ์ƒ์„ฑ - Application ๋ช…์€ ๋ณต์ˆ˜ํ˜•์œผ๋กœ ํ•˜๊ธฐ!

$ python manage.py startapp [Application๋ช…]
 

6. ์•ฑ ๋“ฑ๋ก

ํ”„๋กœ์ ํŠธ์˜ #setting.py์—์„œ INSTALLED_APPS์— Application ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ

๋ฐ˜๋“œ์‹œ ์ƒ์„ฑ ํ›„ ๋“ฑ๋ก!

 

 

'Development > Django' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

Django  (0) 2022.03.07

๋Œ“๊ธ€