54
Python Recipes 2016.7.16 @django girls seoul [email protected] django girls tutorial을 막 마치신 분들께

Python Recipes for django girls seoul

Embed Size (px)

Citation preview

Page 1: Python Recipes for django girls seoul

Python�Recipes

2016.7.16�@django�girls�seoul

[email protected]

django�girls�tutorial을�막�마치신�분들께

Page 2: Python Recipes for django girls seoul

아침마다�영혼이�털리는�두�아이의�엄마

Page 3: Python Recipes for django girls seoul

장고걸스�서울�코치

[이미지�출처�-�django�girls�Facebook](https://www.facebook.com/djangogirlsseoul/)

Page 4: Python Recipes for django girls seoul

구글링과�스택오버플로우�덕분에��하루를�살아가는�프로그래머

[이미지�출처�-�Essential�Copying�and�Pasting�From�Stack�Overflow�-�GitBook](https://www.gitbook.com/book/tra38/essential-copying-and-pasting-from-stack-overflow/details)

Page 5: Python Recipes for django girls seoul

초보가�초보에게��저도�파이썬�잘�모릅니다.�

하지만�초보의�마음은�초보가�가장�잘�알고�있어요.�

그래서�초보로서�도움받았던�자료들을�소개해�볼�예정입니다.

Page 6: Python Recipes for django girls seoul

요리를�처음�시작하는�분들에게��

재료�찾는�방법을�소개해�볼까�합니다.

오늘�많은�재료들을�소개해�드릴텐데,�요리에�이�많은�것들이�모두�필요하지�않습니다.�

이�많은�재료�중에서�필요한�것만�고르면�됩니다.

Page 7: Python Recipes for django girls seoul

파이썬으로�프로그래밍이라는�요리를��

할�때�도움이�되는�재료들을�구해봅시다.

Python�Recipes를�구글링�했더니�진짜�뱀요리�방법이�나옵니다.�ㄷㄷㄷ

Page 8: Python Recipes for django girls seoul

프로그래밍과�요리

Page 9: Python Recipes for django girls seoul

프로그래밍이�마치�레고�조립과�같다는�생각이�들었는데�요리도�마찬가지�입니다.�

글쓰기도,�그림�그리기도,�생활에서�프로그래밍과�관련�된�많은�힌트를�얻을�수�있습니다.

Page 10: Python Recipes for django girls seoul

Python으로�요리하기

•내가�필요한�것을�찾고�무엇을�만들지�생각합니다.�

•음식을�만들기�위해�재료를�찾는�과정과�비슷합니다.�

•황금레시피�=�Best�Practice�를�찾습니다.�

•여러�황금레시피가�있지만�설탕과�소금을�줄이고�쉬운�요리�부터�만들어�봅니다.�

• django를�배운다면�django�girls의�튜토리얼을�따라해�보고�이�튜토리얼이라는�요리에�추가하면�맛이�날�만한�재료를�찾습니다.

Page 11: Python Recipes for django girls seoul

요리재료�장보기�open�source�&�googling

Page 12: Python Recipes for django girls seoul

•괜찮아�보이는(나에게�도움이�될�만한)�오픈소스를�찾습니다.�

•로컬에�clone�받습니다.�

•일단�돌려보지만�잘�안�돌아갈�수도�있습니다.�

•그리고�따라서�만들어�봅니다.�

•내�프로젝트에서�활용해�봅니다.�

• Pull�Request까지�보낼�수�있다면�더�좋습니다.�

•그럼�이제,�Django�Packages�로�재료를�찾으러�가볼게요.

Page 13: Python Recipes for django girls seoul
Page 14: Python Recipes for django girls seoul

요리재료�찾기�Django�Packages

• Django�와�관련�된�패키지들이�모여있습니다.�

• Two�Scoops�of�Django의�저자가�만든�사이트�입니다.�

•여러�패키지들을�비교해�보고�나에�맞는�패키지를�찾습니다.�

•프로그래밍을�많이�알지�못해도�패키지들을�조합해서�하나의�서비스를�만들�수�있습니다.�

•이런�패키지나�라이브러리를�가져다�사용하면서�프로그래밍이�마치�레고조립과�같다는�생각이�들었습니다.�

•그렇다고�쉽다는�건�아닙니다.�

Page 15: Python Recipes for django girls seoul

얼마나�활발하게�업데이트가�되고�있는지,�얼마나�많은�사람이�참여하고�있는지,�얼마나�인기가�있는지…

Page 16: Python Recipes for django girls seoul

virtualenv�와�fabric

•여러�패키지를�로컬에서�맛보기를�하다�보면�환경이�꼬이기도�하고�어떤�패키지를�받았었는지�잊어버리기도�합니다.�

•나는�어느새�설정�지옥으로…��

•게으른�나를�위해�로컬�프로젝트들을�관리해�줍니다.�

• virtualenv�로�환경을�구성하고�fabric�으로�사용하면�내가�사용하고�있는�패키지들을�리스트해�줍니다.�배포도�합니다.�

• virtualenvwrapper�로�필요한�환경을�workon�할�수�있습니다.

Page 17: Python Recipes for django girls seoul

requirements.txt• requirements.txt�로�사용�된�오픈소스와�라이브러리가�무엇인지�알�수�있습니다.�

•아래�두�줄이면�지금�환경에서�어떤�패키지들이�설치되어�있는지�requirements.txt로�정리할�수�있습니다.�

$�pip�install�fabric��

$�pip�freeze�>�requirements.txt�

•배포할�때도�환경이�꼬여서�어려움을�겪을�때도�도움이�됩니다.�

• github�에�있는�프로젝트를�받아�설치할�때�사용합니다.�

$�pip�install�requirements.txt

Page 18: Python Recipes for django girls seoul

Awesome�series�내�입맛에�맞는�소스�찾기

Page 19: Python Recipes for django girls seoul
Page 20: Python Recipes for django girls seoul
Page 21: Python Recipes for django girls seoul

awesome�의�awesome도�있습니다.

Page 22: Python Recipes for django girls seoul

동영상으로�배우기�screencast

Page 23: Python Recipes for django girls seoul

Must-Watch�Series도�있습니다.

Page 24: Python Recipes for django girls seoul

업데이트가�잘�안�되고�있긴�하지만�볼만한�영상들이�있습니다.

Page 25: Python Recipes for django girls seoul

https://github.com/s16h/py-must-watch�업데이트가�잘�안�되고�있으니�누군가�만들어�주셔도�좋아요.�

Page 26: Python Recipes for django girls seoul
Page 27: Python Recipes for django girls seoul

https://gitlab.com/rosarior/django-must-watch

Page 28: Python Recipes for django girls seoul

Youtube에서�Python�tutorial을�찾아봤습니다.

Page 29: Python Recipes for django girls seoul

Django�강좌도�찾아봤습니다.

Page 30: Python Recipes for django girls seoul

django�girls의�Ola가�만든�coding�is�for�girls채널도�있습니다.

Page 31: Python Recipes for django girls seoul

Online�Course

Page 32: Python Recipes for django girls seoul

codecademy의�Python�강좌는�한글도�지원합니다.https://www.codecademy.com/ko/tracks/python-ko

Page 33: Python Recipes for django girls seoul

https://www.hackerrank.com/domains/python/py-introduction

Page 34: Python Recipes for django girls seoul

https://www.codeschool.com/learn/python

•동영상강좌와�슬라이드가�제공�됩니다.�

•온라인�실습�환경�

•일부만�무료입니다.�

•메일링�구독�시�종종�할인쿠폰이�옵니다.

Page 35: Python Recipes for django girls seoul

https://www.codewars.com/?language=python

•난이도별로�문제를�골라�풀�수�있습니다.�

• 문제를�풀기�전에�답을�보게�되면�점수가�깍여요.�

• 문제를�풀고�나서는�다른�사람들의�답을�볼�수�있어요.

Page 36: Python Recipes for django girls seoul

http://tryhelloworld.co.kr/courses/파이썬-입문

Page 37: Python Recipes for django girls seoul

조리도구�IDE

Page 38: Python Recipes for django girls seoul

개인취향

•IDE�는�개인취향�입니다.�강요하지�않아요.�내게�맞는�조리도구는�따로�있습니다.�

•어떤�것을�선택해야�할지�모르겠다면�쉬운�것부터�선택합니다.�그래야�지치지�않아요.�

•부족하다는�생각이�들�때�갈아타고�추가하고�가꿔나갑니다.�

•다른�IDE도�마찬가지지만�편리한�plugin을�찾아보면�엄청�나게�많습니다.�

•많이�연습하고�꾸준히�사용하면�자전거를�타는�것과�같이�익숙해�지고�머리가�아닌�손가락�운동신경에�녹아들게�됩니다.

Page 39: Python Recipes for django girls seoul

vi

• vi�를�사용하는�이유는�IDE환경이�없는�터미널에서도�기본으로�제공하는�툴이기�때문입니다.�

• 6개월�정도�개인사정으로�VI를�사용하지�않았는데도�다시�사용하니�손가락이�기억하고�있었습니다.�

•대부분의�IDE에서는�vi�plugin을�지원합니다.�

•정규표현식의�다양한�응용이�가능합니다.�

•나만의�플러그인과�테마�사용이�가능합니다.

Page 40: Python Recipes for django girls seoul

VI�의�Python-mode

•[python-mode:�Vim�python-mode.�PyLint,�Rope,�Pydoc,�breakpoints�from�box.](https://github.com/klen/python-mode)�

• Python-mode�잔소리꾼은�PEP8에�맞는�컨벤션을�지킬�수�있도록�잔소리를�해줍니다.�

•코드�폴딩기능을�제공합니다.�

• PEP8(인덴트�스페이스4,�너무�긴�라인,�콤마와�오퍼레이터�사이의�여백처리들,�라인여백,�세미콜론의�불필요한�사용�등등)에�익숙해�질�수�있도록�도와줍니다.�

•사용하지�않는�변수를�알려줍니다.�

•불필요하게�import�된�모듈도�알려줍니다.

Page 41: Python Recipes for django girls seoul

PEP�8�--�Style�Guide�for�Python�Code

•https://www.python.org/dev/peps/pep-0008/�

• PEP(Python�Enhance�Proposal)�

• PEP8�—�읽기�쉬운�코드�작성을�위해�

• 탭�대신�스페이스4를�사용�

• 한�줄에�79�캐릭터까지�

• 줄바꿈을�해서�연산자를�사용하면�라인�끝이�아닌�앞쪽에��

• 불필요한�공백은�피하기�

• 불필요한�주석은�피하기�https://www.python.org/dev/peps/pep-0257/

Page 42: Python Recipes for django girls seoul

command-line-tools

•하이라이팅이�중요합니다.��

• syntax�highlight는�지금�무엇을�놓치고�있는지�나를�조언해�주는�강력한�도구�입니다.�

•개발하기�전에�Command-line�에서�먼저�사용해�봅니다.�

•꾸준히�연습해�봅니다.

Page 43: Python Recipes for django girls seoul

기술뉴스�구독

Page 44: Python Recipes for django girls seoul
Page 45: Python Recipes for django girls seoul
Page 46: Python Recipes for django girls seoul

Book

Page 47: Python Recipes for django girls seoul

Two�Scoops�of�Django:��Best�Practices�for�Django�1.8�-�선삽자의�조언

Chapter�1:�Coding�Style�Chapter�2:�The�Optimal�Django�Environment�Setup�Chapter�3:�How�To�Lay�Out�Django�Projects�Chapter�4:�Fundamentals�of�Django�App�Design�Chapter�5:�Settings�and�Requirements�Files�Chapter�6:�Model�Best�Practices�Chapter�7:�Queries�and�the�Database�Layer�Chapter�8:�Function-�and�Class-Based�Views�Chapter�9:�Best�Practices�for�Function-Based�Views�Chapter�10:�Best�Practices�for�Class-Based�Views�Chapter�11:�Form�Fundamentals�Chapter�12:�Common�Patterns�for�Forms�Chapter�13:�Templates:�Best�Practices�Chapter�14:�Template�Tags�and�Filters�.�.

https://www.twoscoopspress.com/

Page 48: Python Recipes for django girls seoul

The�Zen�of�Python�PEP20에�적혀진�19개의�아포리즘�

https://www.python.org/dev/peps/pep-0020/

Page 49: Python Recipes for django girls seoul

Beautiful�is�better�than�ugly.�

아름다움이�추함�보다�좋다.�

Explicit�is�better�than�implicit.�

명시가�암시보다�좋다.�

Simple�is�better�than�complex.�

단순함이�복잡함�보다�좋다.�

Complex�is�better�than�complicated.�

복잡함이�꼬인�것보다�좋다.

번역�출처�:�http://kenial.tistory.com/903

Page 50: Python Recipes for django girls seoul

Errors�should�never�pass�silently.�

오류�앞에서�절대�침묵하지�말지어다.�

Unless�explicitly�silenced.�

명시적으로�오류를�감추려는�의도가�아니라면.�

In�the�face�of�ambiguity,�refuse�the�temptation�to�guess.�

모호함을�앞에�두고,�이를�유추하겠다는�유혹을�버려라.�

There�should�be�one--�and�preferably�only�one�--obvious�way�to�do�it.�

어떤�일에든�명확한�-�바람직하며�유일한�-�방법이�존재한다.

번역�출처�:�http://kenial.tistory.com/903

Page 51: Python Recipes for django girls seoul

Although�that�way�may�not�be�obvious�at�first�unless�you're�Dutch.�

비록�그대가�우둔하여�그�방법이�처음에는�명확해�보이지�않을지라도.�

Now�is�better�than�never.�

지금�하는게�아예�안하는�것보다�낫다.�

Although�never�is�often�better�than�*right*�now.�

아예�안하는�것이�지금�*당장*보다�나을�때도�있지만.

번역�출처�:�http://kenial.tistory.com/903

Page 52: Python Recipes for django girls seoul

If�the�implementation�is�hard�to�explain,�it's�a�bad�idea.�

구현�결과를�설명하기�어렵다면,�그�아이디어는�나쁘다.�

If�the�implementation�is�easy�to�explain,�it�may�be�a�good�idea.�

구현�결과를�설명하기�쉽다면,�그�아이디어는�좋은�아이디어일�수�있다.�

Namespaces�are�one�honking�great�idea�--�let's�do�more�of�those!�

네임스페이스는�대박�좋은�아이디어다�--�마구�남용해라!

번역�출처�:�http://kenial.tistory.com/903

Page 53: Python Recipes for django girls seoul

오늘�많은�자료들을�소개해�드렸지만�이�모든�것을�봐야�한다는�부담을�가지진�마세요.�

사실�저도�잘�모릅니다.�

내�요리에�맞는�조리법만�가져오면�됩니다.

Page 54: Python Recipes for django girls seoul

감사합니다.