Djangoãã¬ãŒã ã¯ãŒã¯ã次ã®ãããžã§ã¯ãã«é©ããŠãããã©ãããéçºè
ãç解ã§ããããã«ããŸãããã å¯èœæ§ãé«ã-é©åã§ãã
åã®ãããžã§ã¯ãã§ç¹å®ã®ããã°ã©ãã³ã°èšèªãŸãã¯ãã¬ãŒã ã¯ãŒã¯ã䜿çšãããšããçç±ã ãã§ããŸãã¯åã«ãããããç¥ã£ãŠãããšããçç±ã ãã§ãç¹å®ã®ããã°ã©ãã³ã°èšèªãŸãã¯ãã¬ãŒã ã¯ãŒã¯ãã€ããŸãªãã§ãã ããã ã ããç©äºã¯è¡ãããŠããŸããã
æ°ãããããžã§ã¯ãã«çæããåã«ãç®çã®çµæãéæããã®ã«æé©ãªèšèªãŸãã¯ãã¬ãŒã ã¯ãŒã¯ãè©äŸ¡ããå¿
èŠããããŸãã ããªãã«ãšã£ãŠæãéèŠãªããšã¯äœã§ããïŒ ã»ãã¥ãªãã£ãéçºé床ãã¹ã±ãŒã©ããªãã£ãæ±çšæ§ããµããŒãïŒ
åŸã§æ¥ãã§æãæ¹ããããããäœæ¥ãéå§ããåã«ååãªæ
å ±ã«åºã¥ããŠæ±ºå®ããããšããå§ãããŸãïŒãŸãã¯ãããã«æªãããšã«ãå®è£
ã®éçšã§ãããžã§ã¯ãã«æŸèæãæããŸã-äºåã«ãµããŒããæ°ã«ããªãã£ãããã§ãïŒã
ç§ã¯é·å¹Žã«ããã£ãŠããŸããŸãªãã¯ãããžãŒã䜿çšããã¢ãã€ã«éçºãšWebéçºã®äž¡æ¹ã«åãçµãã§ãããDjangoã¯ä»ã®Webãã¬ãŒã ã¯ãŒã¯ã«ã¯ãªãæ©èœã®å®å
šãªã»ãããæäŸãããšèããŠããŸãã
ããã¯å€§ããªå£°æã§ãããšç解ããŠããŸãã ãããæ£åœåãããŠãã ããã
ãDjangoã«ã¯ãç¹ã«InstagramãPinterestã§æã掻çºã«äœ¿çšãããŠãããµã€ãããããããããŸãã Facebookã§ãããå€ãã®ãŠãŒãã£ãªãã£ã«Djangoã䜿çšããŠããŸãã Djangoã¯åºçç°å¢ã«ç±æ¥ããããããã®ãã¬ãŒã ã¯ãŒã¯ãThe Washington PostãSmithsonian Magazineãªã©ã®ãµã€ãã§äœ¿çšãããŠããããšã¯é©ãããšã§ã¯ãããŸãããã- Amit Ashvini ãããŒã±ãã£ã³ã°æ
åœå¯ç€Ÿé·@ Zibtek
äžè¬çãªãã¥ãŒïŒDjangoã䜿çšããå Žå
以äžã®ç¹ã®å°ãªããšãããã€ããããªãã«é¢ãããã®ã§ããå ŽåïŒãããŠãããªãã匷ãå察ããç¹ããªã¹ãã«ãªãå ŽåïŒãDjangoã¯ããªãã®ãããžã§ã¯ãã«é©ããŠããå¯èœæ§ãé«ãã§ãã
- Webã¢ããªã±ãŒã·ã§ã³ãŸãã¯ããã¯ãšã³ãAPIãéçºããå¿
èŠããããŸãã
- äœæ¥äžã«ãããžã§ã¯ãããã°ããå±éããè¿
éã«å±éããŠå€æŽããå¿
èŠããããŸãã
- ããã©ã«ãã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã¯æãäžè¬çãªè匱æ§ãšæ»æãç¹ã«CSRFãSQLã€ã³ãžã§ã¯ã·ã§ã³ãXSSãã¯ãªãã¯ãžã£ããã³ã°ãªã©ããä¿è·ãããå¿
èŠããããŸãã
- ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã€ã§ããæ¡åŒµãšçž®å°ã®äž¡æ¹ã®ã¹ã±ãŒãªã³ã°ãå¿
èŠã«ãªãå ŽåããããŸãã
- å°æ¥çã«ã¯ãæ©æ¢°åŠç¿ãªã©ã®ææ°ã®ãã¯ãããžãŒãçµ±åããäºå®ã§ãã
- ç©æ¥µçã«éçºãããäžçäžã®å€ãã®ãããäŒæ¥ãäž»èŠãªWebãµã€ãã§äœ¿çšãããŠããä¿¡é Œã§ãããã¬ãŒã ã¯ãŒã¯ã䜿çšããå¿
èŠããããŸãã
- Webã¢ããªã±ãŒã·ã§ã³ãšAPIã®ãµãŒããŒåŽã®äž¡æ¹ãããåäžã®çå®ã®ãœãŒã¹ãïŒDRYååïŒãšäžèŽããåãã³ãŒãããŒã¹ã«ããå¿
èŠããããŸãã
- ããŒã¿ããŒã¹ã¯ãšãªãçŽæ¥æäœããããªãå ŽåãORMãµããŒããå¿
èŠã§ãã
- ããªãŒãœãããŠã§ã¢ã䜿çšããŸãã
- è¡ãè©°ãŸã£ãå Žåã¯ãèªåã§è§£æ±ºçãæ¢ãå¿
èŠããããããåªããããã¥ã¡ã³ããšå¿çæ§ã®é«ãéçºè
ã³ãã¥ããã£ãå¿
èŠã§ãã
äžèšã®èŠå ã«å ããŠãèªåïŒãŸãã¯ããŒã ïŒã®ã¹ãã«ãèæ
®ããå¿
èŠããããŸãã
ããªããWebéçºè
ã§ãããWebãã©ã®ããã«æ©èœãããããã§ã«ç¥ã£ãŠããå ŽåãDjangoãšã®é£æºã¯æ¯èŒçã¹ã ãŒãºã«æ©èœããŸãã ãã¡ãããDjangoãã©ã®ããã«æ§æãããŠãããããã®ä»ã®ããšãç解ããå¿
èŠããããŸã-ãããŠãæºåãã§ããŠããããšãèæ
®ããŠãã ããã
Djangoãã¬ãŒã ã¯ãŒã¯ã§å®è¡ãããŠãããµã€ã
Djangoã®æŽå²ã¯çŽ10幎åã«é¡ããŸãã ãã®æéäžãå€ãã®ããããµã€ãã§æ¬çªç°å¢ã§äœ¿çšãããŸããã ããã«ããã€ãã®é¡èãªäŸããããŸãïŒ
Pinterestãšã³ãžãã¢ãªã³ã°MozillaBitbucketãŠãããŒããŸãããã£ã¹ã«ã¹ã¯ã·ã³ãã³ãã¹ãNASASpotifyInstagramãšã³ãžãã¢ãªã³ã°ãã·ã§ãã«ãžãªã°ã©ãã£ãã¯ä¿è·è
JsfiddleDjangoãšã®ç·Žç¿ã«è²Žéãªæéãè²»ãã䟡å€ããããã©ããããŸã çåã«æã£ãŠããŸããïŒ ãŸããDjangoããããžã§ã¯ãã«é©åããªãçç±ã«ã€ããŠèª¬æããŸãã
Djangoã䜿çšããªãå Žå
- ããªãã¯å·šå€§ãªã¢ããªã±ãŒã·ã§ã³ãæ±ã£ãŠããã1ã€ã®ã³ãŒãããŒã¹ã«åãŸããŸããã ã¢ããªã±ãŒã·ã§ã³ããã€ã¯ããµãŒãã¹ã«åå²ããããšããå§ãããŸãã åã¬ãã«ã¯ãå°ä»»ã®ããŒã ã«ãã£ãŠé©åã«åŠçãããŸãã ç¹å®ã®ãŠãŒã¹ã±ãŒã¹ããšã«ãä»ã®ãã¯ãããžãŒãé©ããŠããŸãã ãããã®ã·ããªãªã®ããã€ãã§ã¯ãDjangoã䟿å©ãªå ŽåããããŸãããDjangoïŒããã³ä»ã®åå¥ã®ãã¬ãŒã ã¯ãŒã¯ïŒã§ãã®ãããªã¢ããªã±ãŒã·ã§ã³ãå®å
šã«éçºããããšã¯å®çšçã§ã¯ãããŸããã
- ããŒã¿ããŒã¹ãæäœãããããã¡ã€ã«æäœãå®è¡ããããå°ãªããšãå°ãè€éãªããšããããããå¿
èŠã®ãªãåçŽãªã¢ããªã±ãŒã·ã§ã³ãäœæããå¿
èŠããããŸãã
ãã€ã¯ããã¬ãŒã ã¯ãããã®ç¶æ³ã«é©ããŠããŸãã æã人æ°ã®ãããã€ã¯ããã¬ãŒã ã®1ã€-Djangoã®ãããªFlaskã¯Pythonã§æžãããŠããŸãã åæ§ã®ãã€ã¯ããã¬ãŒã ã¯ãä»ã®ãã¯ãããžãŒã§ãå©çšã§ããŸãã PHPã®SlimãJavaã®Apache SparkãNode.jsã®Express.jsãªã© - èªåã§ãã¹ãŠããŒãããæžããäœãããŠããããç¥ãããã
- ããªããŸãã¯ããªãã®ååã¯Django / Pythonã«ãŸã£ããæ
£ããŠããªããããå¿
èŠãªã¹ãã«ã身ã«ä»ããããã®æéãšãªãœãŒã¹ããããŸããã
åŸè
ã®å Žåã®æè¯ã®è§£æ±ºçã¯ãããªããæãããç¥ã£ãŠãããã®ãæ±ãããšã§ãã æ°ãããã¯ãããžãŒããã¬ãŒã ã¯ãŒã¯ãæ¡çšãããšã倱æããå¯èœæ§ãäœåºŠãé«ãŸããŸãã
äžèšã®ãã¹ãŠãããªãã®ãããžã§ã¯ãã«é¢ãããã®ã§ã¯ãªãå ŽåãDjangoãããªãã«åãã§ãããã
Djangoã䜿çšããçç±
Djangoãã¬ãŒã ã¯ãŒã¯ã¯Pythonã§èšè¿°ãããŠããŸãã
ç§ã¯ããªãããããç¥ã£ãŠããããšãç¥ã£ãŠããŸãã
ãããã£ãŠãç§ã¯ãã®æ©äŒãå©çšããŠã圌ãPythonããç¶æ¿ããDjangoã®äž»èŠãªå©ç¹ã®ããã€ãã匷調ããŸãã ç°¡åã«èª¬æããŸãã
Pythonã¯ãäžçã§æã人æ°ããããæãæ¥éã«æé·ããŠããããã°ã©ãã³ã°èšèªã®1ã€ã§ãã
ãœãŒã¹ïŒ
TIOBEã€ã³ããã¯ã¹Indeed.com Jobsã®Coding Dojoã«ããããŒã¿åæGitHubãªã¯ãããŒã¹Pythonã®åŠç¿ã¯éåžžã«ç°¡åã§ãã éåžžãçŸä»£ã®éçºè
ã¯ãã®ç¹å®ã®èšèªãæåã«ç¿åŸããŸãã
äžèšã¯ããã®èšèªãåå¿è
åãã§ããããšããŸã£ããæå³ããŸããã Pythonã¯æå
端ã®æè¡ã§ã䜿çšãããŠããŸãã Pythonã¯ãGoogleãå«ãå€ãã®å·šå€§äŒæ¥ã®æè¡ã¹ã¿ãã¯ã§ç©æ¥µçã«äœ¿çšãããŠããŸãã
Pythonèšèªã¯ãWebã¹ã¯ã¬ã€ãã³ã°ããŒã«ã®éçºã«æé©ã§ãã
ä»ã®èšèªãšããŸãããåãããŸãã
Pythonã®éçºã¯ããã¹ãŠãPythonã®ã¿ã§æžããªããã°ãªããªããšããæå³ã§ã¯ãããŸããã
C / C ++ / Javaãªã©ãä»ã®å€ãã®èšèªã®ã©ã€ãã©ãªã䜿çšã§ããå ŽåããããŸãã
Pythonã¯ç§»æ€æ§ããããèªã¿ãããã§ãã
Pythonã¯JVMäžã§ãå®è¡ã§ããŸãã
Jythonã
ç¥ãã ã
Pythonã¯ãããã°ããŒã¿ãæ©æ¢°åŠç¿ãªã©ã®äžè¬çãªãã¯ãããžãŒã§åºã䜿çšãããŠããŸãã
巚倧ãªPyPIã©ã€ãã©ãªã«ã¢ã¯ã»ã¹ã§ããŸãã
ãžã£ã³ãŽã®ãªãŒã«ã€ã³ã¯ã«ãŒã·ã
ããªãŒã«ã€ã³ã¯ã«ãŒã·ãããšã¯ãDjangoãããã«äœ¿çšã§ããããšãæå³ããäžè¬çãªå®éã®ç¶æ³ã§å¿
èŠãªã»ãšãã©ã®ã©ã€ãã©ãªãšããŒã«ãåããŠããŸãã ãªã¹ãïŒDjango ORMãããã«ãŠã§ã¢ãèªèšŒãHTTPã©ã€ãã©ãªããã«ããµã€ããµããŒããi18nãDjango Adminããã³ãã¬ãŒããšã³ãžã³ãªã© -ããã ãã§ã¯ãããŸããã ç§ãç¥ã£ãŠããä»ã®ãã¬ãŒã ã¯ãŒã¯ã¯ãäžåºŠã«ãã®ãããªå¹
åºããµããŒããæäŸããŸããã
ãããããã€ãã¹ããšèãã人ãããã°ãããã©ã¹ããšèãã人ãããŸãã æ³åŸã®äž¡åŽã¯ããããç¬èªã®æ¹æ³ã§ç°ãªã£ãŠãããããçšåºŠã¯äž¡æ¹ã«åæããŸãã
ãã®ãããªç¶æ³ã§ã¯ãã¬ãŒã ã¯ãŒã¯ãã¢ããªã¹ã«å€ãããããããã¯ãã€ãã¹ã§ãã
ãããã®æ©èœãå¿
èŠãªå Žåãã¢ããªã¹ã®åœ¢æã«ã€ãªããå Žåãäœããã®æ¹æ³ã§ä»ã®ã©ã€ãã©ãªã䜿çšããïŒãŸãã¯èªåã§äœæããïŒå¿
èŠããããŸãã
ã§ã¯ãããããã¹ãŠããã§ã«ååšããæŠéã§ãã¹ããããæ倧ã®ãµã€ãã§åäœããç©æ¥µçã«éçºãããã³ãã¥ããã£ã®ãµããŒããæäŸãããããŒã«ã䜿çšããªãã®ã¯ãªãã§ããïŒ
DjangoãæäŸããæ©èœã®ã»ãšãã©ãå¿
èŠãªãå Žåã¯ããã€ã¯ããã¬ãŒã ã¯ãŒã¯ã«ãšã©ãŸãããšããå§ãããŸãã
è»èŒªãåçºæããªãã§ãã ãã-èŠããŠããŸããïŒ æ¬åœã«éèŠãªããšã«æéããããDjangoã«ä»»ããŸãããã
Django管çè
åã®ã»ã¯ã·ã§ã³ã§ãã®èŠçŽ ã«ã€ããŠèšåããŸãããã泚æãå¿
èŠã§ãã å€ãã®ãã¬ãŒã ã¯ãŒã¯ãç¹ã«LaravelãYiiãªã©ã§ã¯ã管çããã«ã§ã®äœæ¥ãç°¡çŽ åããè©Šã¿ãè¡ãããŠããŸãã ç§ã¯ããŸããŸãªãã¬ãŒã ã¯ãŒã¯ã§å€ãã®ãããžã§ã¯ããéçºããããšãã§ããŸãããã管çããã«ã§ã®äœæ¥ã®å©äŸ¿æ§ã®ããã«ãDjangoãšæ¯èŒã§ãããããžã§ã¯ãã¯ãããŸããã
Django Adminã®æè»æ§ã¯ååã§ã¯ãªããšèããŠãã人ãããŸãããã®äžéšãããŒãºã«åãããŠåŸ®èª¿æŽããã«ã¯ãå€ãã®åªåãå¿
èŠã§ãã æåã¯ãDjangoãšååããŠãããã«åæããåŸåããããŸããããæéããã€ã«ã€ããŠããã¬ãŒã ã¯ãŒã¯ãç解ããããã«ã€ããŠçŽåŸã§ããªããªããŸããã ã¯ããç¬èªã®åŠç¿æ²ç·ããããŸãããããã«å°å¿µããããšã¯ç¡é§ã§ã¯ãããŸããã
å®éãDjango Adminã¯éåžžã«ããæ§æãããŠããŸãã ç§ã®ãããžã§ã¯ãã®äžã«ã¯ãããã®ãŸãŸãã®Django管çããã«ã䜿çšãããã®ãããã°ããŒãããéçºããç¬èªã®ãã³ãã¬ãŒãã«å®å
šã«çœ®ãæãããã®ããããŸããã ãããã«ãããããã¯ç§ãç¥ã£ãŠããä»ã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããéçºãããæéãããããŸããã§ããã
ã¡ã€ã³ãã©ã¹ïŒ ããã«ã¢ã¯ã»ã¹æš©ãšèªèšŒãååŸã§ããŸãã ãã®ãã¹ãŠããŒãããéçºããã«ã¯ãæ°é±éïŒãŸãã¯å°ãªããšãæ°æ¥ïŒããããŸãã
也ç¥åçïŒç¹°ãè¿ããªãã§ãã ããïŒ
ç§ã¯ãæ¯æè
ããDRYãååã«æ¬åœã«æºæ ããŠãããšäž»åŒµããå€ãã®ãã¬ãŒã ã¯ãŒã¯ãç¥ã£ãŠããŸãã ç§ã¯ãã®ãããªå€ãã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããŠããŸãããããããã®ã©ãã«ããDRYãã®ååãå®è£
ãããŠããŸããã
æ®å¿µãªãããã»ãšãã©ã®ãã¬ãŒã ã¯ãŒã¯ã§ã¯ããDRYãã®ååã«ååãªæ³šæãæãããŠããŸããã ç§ã®æèŠã§ã¯ãå®æçã«æŽæ°ããäºå®ã®ã¢ããªã±ãŒã·ã§ã³ïŒã»ãšãã©ã®ææ°ã®ã¢ããªã±ãŒã·ã§ã³ã«ã€ããŠèšããŸãïŒãæžããŠããå Žåãåé¡ãé¿ããããã«DRYã®ååã«åŸãã¹ãã§ãã
ãã®ãããLaravelã§ã¯ãåããã·ãŒãžã£ã®æ€èšŒãåå¥ã«èšè¿°ããå¿
èŠããããŸãã ä»ã®ã»ãšãã©ã®ãã¬ãŒã ã¯ãŒã¯ã§ãåãããšãèšããŸãã ã³ãŒããDRYã®ååã«æºæ ãããã«ã¯ãäžçæžåœåãå¿
èŠããããŸãã ç¹ã«ããŒã ãšããŠåããŠããå Žåã远跡ããã®ã¯é£ããã§ãã
次ã«ãDjangoãã¬ãŒã ã¯ãŒã¯ã¯ãDRYã®ååã«éåããã®ãéåžžãæå³çã«ã®ã¿è¡ãããããã«èšèšãããŠããŸãã
ããã§ã¯ãªãã¯ãã§ãããïŒ äŸãèããŠã¿ãŸãããã
DjangoãããŒã¿ããŒã¹ã®æ€èšŒãšç§»è¡ã§ã©ã®ããã«æ©èœãããã以äžã«ç€ºããŸã
å¿
é ãã£ãŒã«ãã䜿çšããŠ
Model
ã¯ã©ã¹ãäœæããŸãã å¿
èŠãªè¿œå ã®æ€èšŒãšå¶éããã¹ãŠç€ºããŸãã
移è¡ã¯ãåäžã®CLIã³ãã³ããpython manage.py makemigrationsãã«ãã£ãŠçæãããŸãã
å€æŽã¯ããpython manage.py migrateããšãã1ã€ã®CLIã³ãã³ãã§ããŒã¿ããŒã¹ã«å ããããŸãã
æ€èšŒãšå¶éã¯ãCRUDæäœïŒDjango AdminãŸãã¯Django REST FrameworkïŒã®ãã³ã«èªåçã«ãã§ãã¯ãããŸãã æ€èšŒãå床èšè¿°ããå¿
èŠã¯ãããŸããã
Django Admin CRUDãã¥ãŒã®çæã«ã¯åãã¢ãã«ã¯ã©ã¹ã䜿çšãããŸãã ã«ã¹ã¿ã HTML / CSSã¯å¿
èŠãããŸããã
ãããã®æ¡ä»¶ãä»ã®ãã¬ãŒã ã¯ãŒã¯ãšæ¯èŒããŠãã ããã次ã®æ°è¡ã®ã³ãŒãã§ã¯ããã®ãããªããšã¯æ±ºããŠã§ããªããšæããŸãã
class Employee(models.Model): name = models.CharField(max_length=127) email = models.EmailField(null=True, blank=True) created_at = models.DateTimeField(blank=True, null=True, auto_now_add=True) updated_at = models.DateTimeField(blank=True, null=True, auto_now=True)
ããã¯åã«ãç¹°ãè¿ããªããããšã ãã§ã¯ãããŸããã ãã®ã¢ãããŒãã¯ãå°æ¥ã®ãã°ããããªããæããŸãã ç§ãã¡ã¯çãããå Žæã§äœããå€æŽããå¥ã®å Žæã§äº€æããã®ãå¿ããŠããç¶æ³ã§èªåèªèº«ãèŠã€ããŸãã-ãããŠãããã¯å€ãã®ãŠãŒã¶ãŒãåé¡ãæ±ãå§ããŠåããŠæããã«ãªããŸããã
Djangoã§ã¯ãäžèšã®ã³ãŒãã«æ»ãã
`max_length`
ãã£ãŒã«ããå¥ã®ãã®ã«çœ®ãæããå¿
èŠãããå Žåã¯ãããã§å®è¡ããŸãã å€æŽã¯ããã¹ãŠã®ã«ãŒãã®æ€èšŒãšããŒã¿ããŒã¹ã«èªåçã«é©çšãããŸãã
Djangoã®ãªããžã§ã¯ããªã¬ãŒã·ã§ãã«ãããã³ã°
Djangoã¯ããã«æ©èœã®ããã«äœ¿ããORMãšã³ãžã³ãæäŸããŸãã
EloquentãgreenDAOãYii ARãªã©ãããŸããŸãªãã¯ãããžãŒã§å€ãã®ORMããŒã«ã䜿çšããŸããã ãããã®ãã¹ãŠã§ãæãåçŽãªãªã¯ãšã¹ãã¯éåžžã«ããŸãåŠçãããŸãããé
ããæ©ããããããã®ãªã¯ãšã¹ããŸãã¯ãããã®ãªã¯ãšã¹ãããŒãããæžãå¿
èŠããããŸããã
Django ORMã§ã¯ãç§ã¯ãŸã ãã®ãããªç¶æ³ã«ã¯ãããŸããã ããŒã¿ããŒã¹ã¯ãšãªã䜿çšããŠããããšãå¿ããŠããŸãã»ã©ããŸãæ©èœããŸããã ããã¯ããŸãã«ãªããžã§ã¯ããªã¬ãŒã·ã§ãã«ãããã³ã°ã®ã¯ãã§ãã 以äžã«ãDjango ORMã®äŸã瀺ããŸãã
# 5 , rank = 10 age <= 30 top_young_employees = Employee.objects.filter(rank=10, age__lte=30)[:5] # employee = Employee.objects.create(name='John Doe', age=35, country='IN') # print(employee.name)
è¿
éãªéçº
ã»ãšãã©ãã¹ãŠã®Webãã¬ãŒã ã¯ãŒã¯ã®äœæè
ã¯ãããã«ã€ããŠèªæ
¢ããã®ã倧奜ãã§ããããããããã¹ãŠã£ããããšããèšèã«ã©ã®ãããªæå³ãå
¥ãããã«ãã£ãŠã圌ãã¯æ¬åœã«æ£ããã§ãããã
確ãã«ãDjangoã§ã¯ãããã€ãã®ããšãéœæ°ã«é«éã«å®è¡ããŸãã 管çUIãããŒã¿ããŒã¹ããŒãã«ãããã³æ€èšŒãç°¡åã«æ±ºå®ã§ããããšã¯æ¢ã«ããããã§ãããã
ããã¯æ°·å±±ã®äžè§ã«ãããŸããã§ããã
ååãšããŠãè¿
éãªéçºã¯æ©èœãã®ãã®ã§ã¯ãªããDjango DRYãORMããã³ãã¬ãŒããšã³ãžã³ãå
æ¬çãªå²åŠã®ææ©çãªçµæã«ãããŸããã
Django Frameworkã»ãã¥ãªãã£
èªããŸããããéçºè
ã¯æ laãªå ŽåããããŸãã ç§ã¯ãšãŠã確信ããŠããŸãã æã
ç§ã¯å
延ã°ãã«ããéèŠãªã¿ã¹ã¯ã«å¯Ÿãããœãªã¥ãŒã·ã§ã³ãå
éãã«ããŸãã ããã¯ãããŸããŸãªè匱æ§ãçºçããå¯èœæ§ãããå Žæã§ãã
ç§ã¯ç¹ã«ãDjangoãéçºã®é床ãäžããããã«ã»ãã¥ãªãã£ãçããããŠããªããšããäºå®ãæ°ã«å
¥ã£ãŠããŸãã ã»ãã¥ãªãã£æ©èœã¯ããã©ã«ãã§æå¹ã«ãªã£ãŠãããããæ ããŠãããã©ããã¯é¢ä¿ãããŸããã
ãªãŒãã³ãœãŒã¹ãåªããããã¥ã¡ã³ãã巚倧ãªã³ãã¥ããã£ãªã©
Djangoã¯ãªãŒãã³ãœãŒã¹ã§ãããéåžžã«äººæ°ã®ãããã¬ãŒã ã¯ãŒã¯ã§ããããããã®åšãã«ã¬ã¹ãã³ã·ãã³ãã¥ããã£ã圢æãããŸããã ããªãŒãœãããŠã§ã¢ã®å©ç¹ãç¥ã£ãŠãããšæããŸã-ãããŠããããã¯ãã¹ãŠDjangoã«åºæã®ãã®ã§ãã
Djangoã®å
¬åŒããã¥ã¡ã³ãã¯ãã©ã®éçºè
ã«ãšã£ãŠãååã§ãã åããªããªã£ãŠãã解決çãèŠã€ããããšã¯é£ãããããŸããã
Djangoãç¬èªã®ã©ã€ãã©ãªãå€æ°äœæãããšããå°è±¡ãæ¢ã«ãæã¡ãããããŸããããã®ãããããã§ãã¹ãããããã®ç¹å¥ãªã©ã€ãã©ãªããªãããšã«é©ããããããŸããã ããããDjangoãã¬ãŒã ã¯ãŒã¯ããã¹ãããµããŒãããŠããªããšã¯èããªãã§ãã ããããã¹ãããµããŒãããŠããŸãã ãç¹°ãè¿ããªãããšããååã«åŸãã°ããã®çš®ã®åªããã©ã€ãã©ãªãæ¢ã«Pythonèªäœã«ããå Žåããã¹ãçšã®ã©ã€ãã©ãªãéçºããŠãæå³ããããŸããã Djangoã¯åœŒå¥³ãšããŸãããåãããŸãã ããã«ãpytestãªã©ã®ãµãŒãããŒãã£ã©ã€ãã©ãªãšéåžžã«ããæ··ãããŸãã
Djangoããã³ãã®ä»ã®äžè¬çãªãã¬ãŒã ã¯ãŒã¯ã®çŸç¶
ãã®ãããä»ã®ãã¬ãŒã ã¯ãŒã¯ã§äœæ¥ããŠãããšãã«çºçããåé¡ãæ倧éã«åŒ·èª¿ãããããã®ãã¬ãŒã ã¯ãŒã¯ãDjangoãšæ¯èŒããããšæ倧éã«åªããŸããã YiiãCodeIgniterãWordPressãCS-CartãLaravelãªã©ãšé£æºããåŸãç§ã¯Djangoãã©ããããåªããŠãããšããçµè«ã«éããŸããã
ããããããã¯ç§ã®æèŠã§ãã
çµ±èšã奜ããªäººã¯ãDjangoãæã人æ°ããã人æ°ã®ãããã¬ãŒã ã¯ãŒã¯ã®1ã€ã§ãããæ¯å¹Žã®Stack Overflowã®èª¿æ»ãã芧ãã ããã
ãã¬ãŒã ã¯ãŒã¯ãã©ã€ãã©ãªãããã³ããŒã«æãæãããæãããã欲ããã£ããã¬ãŒã ã¯ãŒã¯ãã©ã€ãã©ãªãããã³ããŒã«PHPã§ã®äžèšã®çµéšã«å ããŠãJavaã®Androidã¢ããªã±ãŒã·ã§ã³ãReact.jsã®ã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ãéçºããŸããã ããããã¹ãŠã®ã±ãŒã¹ã§ãã¹ã±ãŒã©ããªãã£ã«åé¡ãçããŠãªãã¡ã¯ã¿ãªã³ã°ãåéããŠããæ°ãæåŸã«ãã³ãŒãããŒã¹ã®ãªãã¡ã¯ã¿ãªã³ã°ã«ããªãã®æéãè²»ãããæé©ãªã¢ãŒããã¯ãã£ãæ¢ããŸããã
ç§ã¯æè¿ãLaravelããDjangoã«ã1幎以äžçç£ããŠãã1ã€ã®ã¢ããªã±ãŒã·ã§ã³ãæžãçŽããŸããã ç§ã¯10æ¥ä»¥å
ã«æ°ããã³ãŒãããŒã¹ãå±éãããã®ããã«æå°éã®ã³ãŒããèšè¿°ããŸããïŒåãããšãèšããŸãïŒè€éããæžããŸãïŒïŒå察ã®æ¹åã§ã¯ããã®ãããªæäœã¯ééããªã1ãæ以äžããããŸãã
ä»ã®ãã¬ãŒã ã¯ãŒã¯ãšDjangoãçŽæ¥æ¯èŒããããšããŠããäœãåŸãããŸããã
ããã©ãŒãã³ã¹ç£èŠã«ãããJavaãã¬ãŒã ã¯ãŒã¯ãDjangoãããé«éã§ããããšã瀺ãããå ŽåããããŸãã PHPãåŸæã§ãããããDjangoã§ã®ã¢ããªã±ãŒã·ã§ã³éçºã¯ã䜿ãæ
£ããPHPãã¬ãŒã ã¯ãŒã¯ã䜿çšããå Žåãããé«éã«ãªãå¯èœæ§ããããŸãã éåžžã«åçŽãªã¢ããªã±ãŒã·ã§ã³ã®å ŽåãDjangoã®ã»ããã¢ããã¯å°ãé¢åã«æãããããããŸããããã¡ãããã¹ã¯ãªããã䜿çšããŠãã¡ã€ã«ãäœæããæ¹ãã¯ããã«ç°¡åã§ãã 調æ»çµæã¯ãå®æœããã察象è
ã«ãã£ãŠç°ãªãå ŽåããããŸãã
ãã ããããã§ã¯ãä»ã®æè¡ã«é¢é£ãããã¬ãŒã ã¯ãŒã¯ã«ã€ããŠã®ã¿èª¬æããŠããããã§ã¯ãããŸããã Pythonã«ç²ŸéããŠããŠããFlaskãã€ã¯ããã¬ãŒã ã¯ãŒã¯ã®æ¹ã䟿å©ã§æãŸããå ŽåããããŸãã ããªãã¯ã©ã¡ãã§ç«ã¡æ¢ãŸããã«ã€ããŠèããå¿
èŠããããŸãã
ç§ã®ã¢ããã€ã¹ã¯åã«ããããæ¯èŒããªãããšã§ãã
ãããã«
ç§ã®æèŠã§ã¯ãDjangoã¯ããã©ãŒãã³ã¹ãã¢ãŒããã¯ãã£ãéçºã®è€éããã»ãã¥ãªãã£ãããã³ã¹ã±ãŒã©ããªãã£ã®ãã©ã³ã¹ãããŸããšãããšãã§ããŸããã
ãããžã§ã¯ãããŒãããæžãå§ããŠããå Žåã¯ãDjangoã䜿çšããŠäœæããããšã匷ããå§ãããŸãã