Djangoチュートリアルハンズオン補足資料

 Djangoチュートリアルハンズオン補足資料

Cd9ef6a65ed76cdccedf0abfbd3d2749?s=128

soheiyagi

May 02, 2020
Tweet

Transcript

  1. %KBOHPνϡʔτϦΞϧ ϋϯζΦϯิ଍ࢿྉ

  2. ؀ڥߏங ˞࡞ۀϑΥϧμ࡞੒
 NLEJSEKBOHP@UVUPSJBM
 DEEKBOHP@UVUPSJBM ˞BOBDPOEBͷ৔߹
 DPOEBDSFBUFZOEKBOHP@UVUPSJBMQZUIPO
 DPOEBBDUJWBUFEKBOHP@UVUPSJBM ˞WFOWͷ৔߹
 QZUIPONWFOWWFOW@EKBOHP@UVUPSJBM
 TPVSDFWFOW@EKBOHP@UVUPSJBMCJOBDUJWBUF


    
 8JOEPXTͷ৔߹ʢTPVSDFίϚϯυͷ୅ΘΓʣ
 WFOW@EKBOHP@UVUPSJBM4DSJQUTBDUJWBUF
  3. VSMTQZ WJFXTQZ )UUQ3FRVFTU NPEFMTQZ 5FNQMBUFT )UUQ3FTQPOTF σʔλϕʔε %KBOHPॲཧͷશମͷྲྀΕ

  4. %KBOHPϑΥϧμߏ੒ 1SPKFDUϑΥϧμ
 @@JOJU@@QZ
 BTHJQZ
 TFUUJOHTQZ
 VSMTQZ
 XTHJQZ ɹ"QQϑΥϧμ
 ɹNJHSBUJPOT
 ɹ@@JOJU@@QZ


    ɹBENJOQZ
 ɹBQQTQZ
 ɹNPEFMTQZ
 ɹUFTUTQZ
 ɹWJFXTQZ NBOBHFQZ QZUIPONBOBHFQZTUBSUBQQ˔˔ EKBOHPBENJOTUBSUQSPKFDU˔˔ "11ϑΥϧμʹ΋
 VSMTQZΛ௥Ճͨ͠ํ͕࢖͍΍͍͢
  5. VSMTQZͷؔ܎ NZTJUF
 @@JOJU@@QZ
 BTHJQZ
 TFUUJOHTQZ
 VSMTQZ
 XTHJQZ ɹQPMMT
 ɹNJHSBUJPOT
 ɹ@@JOJU@@QZ


    ɹBENJOQZ
 ɹBQQTQZ
 ɹNPEFMTQZ
 ɹUFTUTQZ
 ɹVSMTQZ
 ɹWJFXTQZ NBOBHFQZ from django.contrib import admin from django.urls import path, include urlpatterns = [ path("admin/", admin.site.urls), path(“polls/”, include(“polls.urls")), ] from django.urls import path
 from . import views urlpatterns = [ path("", views.index, name="index" ), ] from django.http import HttpResponse def index(request): return HttpResponse(“Hello world!”) QPMMTVSMTQZ QPMMTWJFXTQZ VSMTQZ
  6. VSMTQZͷؔ܎ ϓϩδΣΫτ
 VSMTQZ QBUI ϓϩδΣΫτ
 VSMTQZ VSM ΞϓϦ
 VSMTQZ QBUI

    ΞϓϦʢQPMMTʣ
 VSMTQZ lBENJOz IUUQBENJO lQPMMTz IUUQQPMMT zz IUUQQPMMT lJOURVFTUJPO@JEz IUUQQPMMT lJOURVFTUJPO@JE SFTVMUTz IUUQQPMMT SFTVUT lJOURVFTUJPO@JE WPUFz IUUQQPMMT WPUF JODMVEF
  7. Πϯϙʔτʹؔ͢Δิ଍ NZTJUF
 @@JOJU@@QZ
 BTHJQZ
 TFUUJOHTQZ
 VSMTQZ
 XTHJQZ ɹQPMMT
 ɹNJHSBUJPOT
 ɹ@@JOJU@@QZ


    ɹBENJOQZ
 ɹBQQTQZ
 ɹNPEFMTQZ
 ɹUFTUTQZ
 ɹVSMTQZ
 ɹWJFXTQZ NBOBHFQZ from django.urls import path from .views import index urlpatterns = [ path("", index, name=“index" ), ] GSPNύοέʔδJNQPSUؔ਺PSΫϥε
 JNQPSUύοέʔδ from django.urls import path from . import views urlpatterns = [ path("", views.index, name=“index" ), ] ಉ݁͡Ռ
  8. Πϯϙʔτʹؔ͢Δิ଍ NZTJUF
 @@JOJU@@QZ
 BTHJQZ
 TFUUJOHTQZ
 VSMTQZ
 XTHJQZ ɹQPMMT
 ɹNJHSBUJPOT
 ɹ@@JOJU@@QZ


    ɹBENJOQZ
 ɹBQQTQZ
 ɹNPEFMTQZ
 ɹUFTUTQZ
 ɹVSMTQZ
 ɹWJFXTQZ NBOBHFQZ from django.urls import path, include from polls.views import hello_world urlpatterns = [ path("", index, name="index" ), ] GSPNύοέʔδJNQPSUؔ਺PSΫϥε
 JNQPSUύοέʔδ from django.urls import path, include from polls import views urlpatterns = [ path("", views.index, name=“index" ), ] ಉ݁͡Ռ
  9. NBLFNJHSBUJPOTͱNJHSBUF QZUIPONBOBHFQZNBLFNJHSBUJPOT QZUIPONBOBHFQZNJHSBUF ɾ%#ͷ࡞੒΍ߋ৽ͷͨΊͷઃܭॻΛ࡞੒͢Δ
 ɾNJHSBUJPOϑΥϧμʹϑΝΠϧΛੜ੒ ɾϚΠάϨʔγϣϯϑΝΠϧΛ࣮ߦͯ͠%#ͷ࡞੒΍ߋ৽Λߦ͏

  10. ؔ਺ϕʔεϏϡʔͱΫϥεϕʔεϏϡʔ ؔ਺ϕʔεϕʔεϏϡʔ ΫϥεϕʔεϕʔεϏϡʔ ɾϚχϡΞϧंͷΠϝʔδ
 ɾࣗ෼Ͱࣗ༝ʹ࡞ΕΔ
 ɾίʔυྔ͕ଟ͍ ɾΦʔτϚंͷΠϝʔδ
 ɾ%KBOHPͷࢿ࢈͕࢖͑Δ
 ɾઃఆΛ্ॻ͖Ͱ࢖͑Δ

  11. ؔ਺ϕʔεϏϡʔͱΫϥεϕʔεϏϡʔ ؔ਺ϕʔεϕʔεϏϡʔ EFGJOEFY SFRVFTU  MBUFTU@RVFTUJPO@MJTU2VFTUJPOPCKFDUTPSEFS@CZ QVC@EBUF <> DPOUFYU\MBUFTU@RVFTUJPO@MJTUMBUFTU@RVFTUJPO@MJTU^ SFUVSOSFOEFS

    SFRVFTU QPMMTJOEFYIUNM DPOUFYU  ؔ਺ϕʔεϏϡʔͰॻ͘৔߹͸ୈҾ਺ʹSFRVFTU͕ඞਢ
  12. ؔ਺ϕʔεϏϡʔͱΫϥεϕʔεϏϡʔ ؔ਺ϕʔεϕʔεϏϡʔ DMBTT*OEFY7JFX HFOFSJD-JTU7JFX  UFNQMBUF@OBNFQPMMTJOEFYIUNM DPOUFYU@PCKFDU@OBNFMBUFTU@RVFTUJPO@MJTU EFGHFU@RVFSZTFU TFMG 

    SFUVSO2VFTUJPOPCKFDUTPSEFS@CZ QVC@EBUF <> ൚༻ϏϡʔʢHFOFSJDʣΛ࢖͏͜ͱͰίʔυྔগͳ࣮͘૷Մೳ ൚༻Ϗϡʔͷίʔυ΍ཁૉΛ֬ೝ͢Δͷ͸ͪ͜Β͕ศརɹIUUQTDDCWDPVL