๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ชBackend/Django

Django๋กœ pinterest ๋”ฐ๋ผ๋งŒ๋“ค๊ธฐ : ์„น์…˜ 1. Django Tutorial (5~7๊ฐ•)

#5 ์ฒซ ์•ฑ ์‹œ์ž‘, ๊ทธ๋ฆฌ๊ณ  ๊ธฐ๋ณธ์ ์ธ view ๋งŒ๋“ค๊ธฐ

  • accountapp์ด๋ผ๋Š” ์ƒˆ๋กœ์šด ์•ฑ ์‹ ๊ณ 
python manage.py startapp accountapp

 

 

  • ํ”„๋กœ์ ํŠธ ํŒŒ์ผ > settings.py ์—์„œ ์œ„์˜ ์•ฑ ์‚ฌ์šฉํ•  ๊ฑฐ๋ผ๊ณ  ๋ช…์‹œ

        => INSTALLED_APPS =[] ๋ฆฌ์ŠคํŠธ์— accountapp ์ถ”๊ฐ€

 

 

  • accountapp > views.py ์—์„œ ๊ธฐ๋ณธ์ ์ธ ๋ทฐ ์ƒ์„ฑ

        ⇒ httpresponse๋กœ helloworld return ํ•˜๋Š” ๋ทฐ ์ƒ์„ฑํ•จ

 

 

  • pragmatic > urls.py ์—์„œ ๋ผ์šฐํŒ…์„ ์œ„ํ•œ url ์ƒ์„ฑ

        ⇒ path ์™€ include ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด์„œ accountapp ๋‚ด์— ์žˆ๋Š” ๋™์ž‘ ์‹คํ–‰ํ•˜๋„๋ก

 

 

  • accountapp > urls.py ์ƒ์„ฑ

        ⇒ pragmatic ์— ์žˆ๋˜ urls.py ์—์„œ์ฒ˜๋Ÿผ urls [] ์ƒ์„ฑ

 

์„œ๋ฒ„ ์‹คํ–‰ ํ›„ test

hello world ์ž˜ ์ถœ๋ ฅ๋จ!!!

 

 

 


 

#6 Git ์†Œ๊ฐœ

Version Control

⇒ git์˜ ์œ ๋ฌด๋Š” ๋ฒ„์ „ ๊ด€๋ฆฌ์— ์žˆ์–ด์„œ ๋งค์šฐ ์ค‘์š” , ๊ทธ ์™ธ์—๋„ ํ˜‘์—… ํ•˜๊ธฐ์— ์ข‹์€ ์žฅ์น˜

 

command

  • add
  • commit
  • push
  • pull
  • branch , checkout

๋“ฑ ํ•ด๋‹น ๊ฐ•์˜์—์„œ ์‚ฌ์šฉํ•  ๊นƒ ์ปค๋งจ๋“œ

 

 


 

 

#7 Gitignore ์„ค์ •, ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋ถ„๋ฆฌ, ์ฒซ ์ปค๋ฐ‹

์ตœ์ƒ์œ„ ํด๋”์—์„œ .gitignore ์„ค์ •

https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

 

์œ„์—์„œ ์ œ๊ณตํ•ด์ฃผ๋Š” gitignore ๊ธ์–ด์˜ค๊ธฐ

์ถ”์  ํ•„์š”์—†๋Š” ํŒŒ์ผ๋“ค ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ

 

secret key ๊ด€๋ฆฌ

Quick Start - django-environ

 

Quick Start - django-environ

Previous Installation

django-environ.readthedocs.io

pip install django-envirion ์„ค์น˜ ํ•ด์„œ ์‹œํฌ๋ฆฟ ํ‚ค ๋…ธ์ถœํ•˜์ง€ ์•Š๊ณ  ๋ถˆ๋Ÿฌ์˜ค๋Š” ์‹์œผ๋กœ ์ž‘๋™ํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •ํ•ด์ฃผ๊ธฐ

 

 

git ์ปค๋ฐ‹ ํ•˜๊ธฐ

๋ณธ์ธ git bash ์ด์šฉ : ์ง€๊ธˆ๊นŒ์ง€ ์ƒ์„ฑํ•œ ์ฝ”๋“œ๋“ค master branch ์— first commit message๋กœ ๋„ฃ์–ด์คŒ

 

 


๋ฐ•ํ™์„๋‹˜์˜ ์ธํ”„๋Ÿฐ ๊ฐ•์˜๋ฅผ ์ˆ˜๊ฐ•ํ•˜๋ฉฐ ์ •๋ฆฌํ•ด๋ณด๋Š” ๊ธ€์ž…๋‹ˆ๋‹ค.

https://www.inflearn.com/course/%EC%9E%A5%EA%B3%A0-%ED%95%80%ED%84%B0%EB%A0%88%EC%8A%A4%ED%8A%B8

 

์ž‘์ •ํ•˜๊ณ  ์žฅ๊ณ ! Django๋กœ Pinterest ๋”ฐ๋ผ๋งŒ๋“ค๊ธฐ : ๋ฐ”๋‹ฅ๋ถ€ํ„ฐ ๋ฐฐํฌ๊นŒ์ง€ ๊ฐ•์˜ - ์ธํ”„๋Ÿฐ

Python์˜ ๋Œ€ํ‘œ ์›น ํ”„๋ ˆ์ž„์›Œํฌ django๋ฅผ ์ด์šฉํ•ด Pinterest ํŠน์œ ์˜ ์นด๋“œํ˜• ๋ ˆ์ด์•„์›ƒ ๋””์ž์ธ์„ ๋ณธ๋”ด ์›น์„œ๋น„์Šค ๊ตฌํ˜„ํ•ด๋ด…๋‹ˆ๋‹ค., django, docker ์‹ค์ „ ๊ฐœ๋ฐœ์„ ํ†ตํ•ด ํ•œ ๋‹จ๊ณ„ ๋†’์€ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜