SlideShare a Scribd company logo
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django AUTHORS   Python   Google   3
7                10


    Django   5
Django
PHP   Python
2003
Ruby on Rails
2005
World Online often has only
a matter of hours to take a complicated
Web application from concept to public launch.
…
…
…
DB
URL
DB
URL
DB
URL
DB
URL
DB
URL
DB
URL
85%
http://www2.ljworld.com/




LJWorld   …
http://www2.ljworld.com/
                     2005
Django          Adrian
http://www2.ljworld.com/
                     2005
Django          Adrian
http://www2.ljworld.com/
                     2005
Django          Adrian
http://www2.ljworld.com/
                     2005
Django          Adrian
http://www2.ljworld.com/
                     2005
Django          Adrian
…   …
Django - 次の一歩 gumiStudy#3
27.6
django-admin.py startproject startapp


                                        manage.py
4       settings.py


    4
4       settings.py


    4
4       settings.py


    4
settings.py   INSTALLED_APPS
5                        Web




    blog                                  blog
settings.py   INSTALLED_APPS
5                        Web




    blog                                  blog
10                                           manage.py shell             blog
                                  startapp            gumistudy.blog   blog


manage.py           ./manage.py                          PYTHONPATH             Python Shell
            gumistudy.blog
                                                          manage.py
                    PYTHONPATH                 blog
…
Django
Django
Django - 次の一歩 gumiStudy#3
admindoc
              Django
       view
                       Django BIDI
Django - 次の一歩 gumiStudy#3
RegexValidator
        ■    URLValidator
        ■    validate_email
        ■    validate_slug
        ■    validate_ipv4_address
        ■    validate_comma_separated_integer_list
        ■    MaxValueValidator
        ■    MinValueValidator
        ■    MaxLengthValidator
        ■    MinLengthValidator

                                                     Model
validators                                                   validator
  …
ValidationError raise
                        DRY
CharField Integer
validators               RegexValidator                                 validator
             CharField           SlugField                       Slug               URL
                                DB
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
models
models.py
models
models.py
…
models   import   models
                       meta       app_label
…
models   import   models
                       meta       app_label
Django - 次の一歩 gumiStudy#3
…


                        Entry       django.contrib.auth          User
       Entry   auhtor                     User     Entry
User              entry_set
                                                          User
…


                        Entry       django.contrib.auth          User
       Entry   auhtor                     User     Entry
User              entry_set
                                                          User
django.contrib.auth
                                      django.contrib.contenttypes
ContentType                         django.contrib.auth
django.contrib.auth
                                      django.contrib.contenttypes
ContentType                         django.contrib.auth
memcached
Signal
Signal
                  send
Signal
Signal
                  send
Signal
Signal
                  send
send    sender args


                        connect
          sender args
connect                      sender
send    sender args


                        connect
          sender args
connect                      sender
send    sender args


                        connect
          sender args
connect                      sender
…
Python
Python
Python
Abstract   syncdb
…   Proxy
…   Proxy
O/R Mapper    SQL


O/R Mapper           SQL         SQL
objects
              filter exclude       all
…                             …         all   filter
                              …
objects
              filter exclude       all
…                             …         all   filter
                              …
objects
              filter exclude       all
…                             …         all   filter
                              …
objects
              filter exclude       all
…                             …         all   filter
                              …
F Aggregation
F


        Aggregation             aggregate annotate       aggregate
    annotate                                         Aggregate Annotate
          Queryset
F Aggregation
F


        Aggregation             aggregate annotate       aggregate
    annotate                                         Aggregate Annotate
          Queryset
F Aggregation
F


        Aggregation             aggregate annotate       aggregate
    annotate                                         Aggregate Annotate
          Queryset
DRY
           Queryset               get_query_set


               Entry         public_objects pub_date       Queryset


objects   Manager                                 Django
                         Django
DRY
           Queryset               get_query_set


               Entry         public_objects pub_date       Queryset


objects   Manager                                 Django
                         Django
Django
         Django
Django
         Django
using   using   default
using   using   default
Django                                    DatabaseRouters
DatabaseRouters                                               syncdb


    None          None   Django   DatabaseRouter
default
Django
Django            django.contrib
1:30   )




           bitbucket
1:30   )




           bitbucket
ModelAdmin
   Queryset          Queryset   bulk update
save
ModelAdmin
   Queryset          Queryset   bulk update
save
Django
Django   Ellington   CMS
                                    admin
settings.py            TEMPLATE_LOADERS                 TEMPLATE_DIRS
TEMPLATE_LOADERS       filesystem.Loader app_directories.Loader              TEMPLATE_DIRS
                                                                      TEMPLATE_DIRS
       app_directories.Loader
settings.py            TEMPLATE_LOADERS                 TEMPLATE_DIRS
TEMPLATE_LOADERS       filesystem.Loader app_directories.Loader              TEMPLATE_DIRS
                                                                      TEMPLATE_DIRS
       app_directories.Loader
app_directories.Loader
                     Django                               templates
                                 app_directories.Loader
                     templates
app_directories.Loader
                     Django                               templates
                                 app_directories.Loader
                     templates
app_directories.Loader
                     Django                               templates
                                 app_directories.Loader
                     templates
filesystem.Loader TEMPLATE_DIRS


                             templates
                                         TEMPLATE_DIRS
filesystem.Loader TEMPLATE_DIRS


                             templates
                                         TEMPLATE_DIRS
Django   Django
2
admin/site_base.html                   …
  app_directory.Loader   filesystem.Loader
admin/site_base.html                   …
  app_directory.Loader   filesystem.Loader
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
! <html>
!!! <head>{% block title %}              {% endblock title %}</head>
    <script type="text/javascript" src="common.js"></script>
    {% block custom_js %}{% endblock custom_js %}
!!! <body>
!!! <div id="menu">{% block menu %}{% endblock menu %}</div>
!!! <div id="content">{% block content %}{% endblock content %}</div>
    <div id=”copyright”>{% block copyright %}everes{% endblock %}</div>
!!! </body>
! </html>




! {% extends 'base.html% %}
! {% block title %}{{ block.super }}            {% endblock title %}
! {% block menu %}                      {% endblock menu %}




! {% extends 'app/base.html' %}
! {% block content %}                  {% endblock content %}
! <html>
!!! <head>{% block title %}              {% endblock title %}</head>
    <script type="text/javascript" src="common.js"></script>
    {% block custom_js %}{% endblock custom_js %}
!!! <body>
!!! <div id="menu">{% block menu %}{% endblock menu %}</div>
!!! <div id="content">{% block content %}{% endblock content %}</div>
    <div id=”copyright”>{% block copyright %}everes{% endblock %}</div>
!!! </body>
! </html>




! {% extends 'base.html% %}
! {% block title %}{{ block.super }}            {% endblock title %}
! {% block menu %}                      {% endblock menu %}




! {% extends 'app/base.html' %}
! {% block content %}                  {% endblock content %}
! <html>
!!! <head>{% block title %}              {% endblock title %}</head>
    <script type="text/javascript" src="common.js"></script>
    {% block custom_js %}{% endblock custom_js %}
!!! <body>
!!! <div id="menu">{% block menu %}{% endblock menu %}</div>
!!! <div id="content">{% block content %}{% endblock content %}</div>
    <div id=”copyright”>{% block copyright %}everes{% endblock %}</div>
!!! </body>
! </html>




! {% extends 'base.html% %}
! {% block title %}{{ block.super }}            {% endblock title %}
! {% block menu %}                      {% endblock menu %}




! {% extends 'app/base.html' %}
! {% block content %}                  {% endblock content %}
! <html>
!!! <head>{% block title %}              {% endblock title %}</head>
    <script type="text/javascript" src="common.js"></script>
    {% block custom_js %}{% endblock custom_js %}
!!! <body>
!!! <div id="menu">{% block menu %}{% endblock menu %}</div>
!!! <div id="content">{% block content %}{% endblock content %}</div>
    <div id=”copyright”>{% block copyright %}everes{% endblock %}</div>
!!! </body>
! </html>




! {% extends 'base.html% %}
! {% block title %}{{ block.super }}            {% endblock title %}
! {% block menu %}                      {% endblock menu %}




! {% extends 'app/base.html' %}
! {% block content %}                  {% endblock content %}
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3

More Related Content

PDF
Moving from Django Apps to Services
PDF
The effective use of Django ORM
PDF
The Best (and Worst) of Django
PDF
Introduction To Django (Strange Loop 2011)
PDF
Introducing Assetic (NYPHP)
PDF
Assetic (Symfony Live Paris)
PDF
Django a whirlwind tour
PDF
Advanced symfony Techniques
Moving from Django Apps to Services
The effective use of Django ORM
The Best (and Worst) of Django
Introduction To Django (Strange Loop 2011)
Introducing Assetic (NYPHP)
Assetic (Symfony Live Paris)
Django a whirlwind tour
Advanced symfony Techniques

What's hot (20)

PPTX
Let's write secure Drupal code! DUG Belgium - 08/08/2019
PDF
Django Heresies
PPTX
Let's write secure drupal code! - Drupal Camp Pannonia 2019
PDF
Assetic (Zendcon)
PPTX
Puppet camp chicago-automated_testing2
PDF
Introducing Assetic: Asset Management for PHP 5.3
PDF
With a Mighty Hammer
PDF
WCLV13 JavaScript
PDF
Hooks WCSD12
PDF
Doctrine MongoDB ODM (PDXPHP)
PDF
Rails 3: Dashing to the Finish
PDF
Rails 3 overview
PDF
A Little Backbone For Your App
PDF
Mojolicious
PPTX
Maintainable JavaScript 2012
PDF
Django REST Framework
PPT
Spring data iii
KEY
Intro To Moose
PPTX
Let's write secure Drupal code! - Drupal Camp Poland 2019
PDF
OSCON Google App Engine Codelab - July 2010
Let's write secure Drupal code! DUG Belgium - 08/08/2019
Django Heresies
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Assetic (Zendcon)
Puppet camp chicago-automated_testing2
Introducing Assetic: Asset Management for PHP 5.3
With a Mighty Hammer
WCLV13 JavaScript
Hooks WCSD12
Doctrine MongoDB ODM (PDXPHP)
Rails 3: Dashing to the Finish
Rails 3 overview
A Little Backbone For Your App
Mojolicious
Maintainable JavaScript 2012
Django REST Framework
Spring data iii
Intro To Moose
Let's write secure Drupal code! - Drupal Camp Poland 2019
OSCON Google App Engine Codelab - July 2010
Ad

Viewers also liked (8)

ZIP
引き出しとしてのDjango - SoozyCon7
ZIP
変態的PHPフレームワーク rhaco
PDF
Not free
PDF
ZIP
Python Workshop the Edge - django
PDF
Webフレームワークパネル(Django) at PyConJP 2012
PDF
Erulolo at Kamakurago #1
ZIP
伝説のギタリストじゃない方のDjango
引き出しとしてのDjango - SoozyCon7
変態的PHPフレームワーク rhaco
Not free
Python Workshop the Edge - django
Webフレームワークパネル(Django) at PyConJP 2012
Erulolo at Kamakurago #1
伝説のギタリストじゃない方のDjango
Ad

Similar to Django - 次の一歩 gumiStudy#3 (20)

KEY
國民雲端架構 Django + GAE
KEY
Developing With Django
PDF
django_reference_sheet
PDF
Web Development with Python and Django
PDF
GDG Addis - An Introduction to Django and App Engine
PDF
Python - A Comprehensive Programming Language
KEY
Introduction to Django
KEY
What's new in Django 1.2?
PDF
State Of Django
PDF
Django Overview
KEY
Django Pro ORM
PDF
Introduction to Django
PDF
Django at Scale
PDF
Django - basics
PDF
Google app-engine-with-python
ODP
Introduction to Django
KEY
Ladypy 01
PPTX
The Django Web Application Framework 2
PPTX
The Django Web Application Framework 2
PPTX
The Django Web Application Framework 2
國民雲端架構 Django + GAE
Developing With Django
django_reference_sheet
Web Development with Python and Django
GDG Addis - An Introduction to Django and App Engine
Python - A Comprehensive Programming Language
Introduction to Django
What's new in Django 1.2?
State Of Django
Django Overview
Django Pro ORM
Introduction to Django
Django at Scale
Django - basics
Google app-engine-with-python
Introduction to Django
Ladypy 01
The Django Web Application Framework 2
The Django Web Application Framework 2
The Django Web Application Framework 2

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Monthly Chronicles - July 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
A Presentation on Artificial Intelligence
NewMind AI Monthly Chronicles - July 2025

Django - 次の一歩 gumiStudy#3

  • 3. Django AUTHORS Python Google 3
  • 4. 7 10 Django 5
  • 6. PHP Python
  • 10. World Online often has only a matter of hours to take a complicated Web application from concept to public launch.
  • 11.
  • 12.
  • 13.
  • 20. 85%
  • 27.
  • 30. 4 settings.py 4
  • 31. 4 settings.py 4
  • 32. 4 settings.py 4
  • 33. settings.py INSTALLED_APPS 5 Web blog blog
  • 34. settings.py INSTALLED_APPS 5 Web blog blog
  • 35. 10 manage.py shell blog startapp gumistudy.blog blog manage.py ./manage.py PYTHONPATH Python Shell gumistudy.blog manage.py PYTHONPATH blog
  • 36.
  • 40. admindoc Django view Django BIDI
  • 42. RegexValidator ■ URLValidator ■ validate_email ■ validate_slug ■ validate_ipv4_address ■ validate_comma_separated_integer_list ■ MaxValueValidator ■ MinValueValidator ■ MaxLengthValidator ■ MinLengthValidator Model validators validator …
  • 44. CharField Integer validators RegexValidator validator CharField SlugField Slug URL DB
  • 49. … models import models meta app_label
  • 50. … models import models meta app_label
  • 52. Entry django.contrib.auth User Entry auhtor User Entry User entry_set User
  • 53. Entry django.contrib.auth User Entry auhtor User Entry User entry_set User
  • 54. django.contrib.auth django.contrib.contenttypes ContentType django.contrib.auth
  • 55. django.contrib.auth django.contrib.contenttypes ContentType django.contrib.auth
  • 60. send sender args connect sender args connect sender
  • 61. send sender args connect sender args connect sender
  • 62. send sender args connect sender args connect sender
  • 63.
  • 67. Abstract syncdb
  • 68. Proxy
  • 69. Proxy
  • 70. O/R Mapper SQL O/R Mapper SQL SQL
  • 71. objects filter exclude all … … all filter …
  • 72. objects filter exclude all … … all filter …
  • 73. objects filter exclude all … … all filter …
  • 74. objects filter exclude all … … all filter …
  • 75. F Aggregation F Aggregation aggregate annotate aggregate annotate Aggregate Annotate Queryset
  • 76. F Aggregation F Aggregation aggregate annotate aggregate annotate Aggregate Annotate Queryset
  • 77. F Aggregation F Aggregation aggregate annotate aggregate annotate Aggregate Annotate Queryset
  • 78. DRY Queryset get_query_set Entry public_objects pub_date Queryset objects Manager Django Django
  • 79. DRY Queryset get_query_set Entry public_objects pub_date Queryset objects Manager Django Django
  • 80. Django Django
  • 81. Django Django
  • 82. using using default
  • 83. using using default
  • 84. Django DatabaseRouters DatabaseRouters syncdb None None Django DatabaseRouter default
  • 85. Django Django django.contrib
  • 86. 1:30 ) bitbucket
  • 87. 1:30 ) bitbucket
  • 88. ModelAdmin Queryset Queryset bulk update save
  • 89. ModelAdmin Queryset Queryset bulk update save
  • 90. Django Django Ellington CMS admin
  • 91. settings.py TEMPLATE_LOADERS TEMPLATE_DIRS TEMPLATE_LOADERS filesystem.Loader app_directories.Loader TEMPLATE_DIRS TEMPLATE_DIRS app_directories.Loader
  • 92. settings.py TEMPLATE_LOADERS TEMPLATE_DIRS TEMPLATE_LOADERS filesystem.Loader app_directories.Loader TEMPLATE_DIRS TEMPLATE_DIRS app_directories.Loader
  • 93. app_directories.Loader Django templates app_directories.Loader templates
  • 94. app_directories.Loader Django templates app_directories.Loader templates
  • 95. app_directories.Loader Django templates app_directories.Loader templates
  • 96. filesystem.Loader TEMPLATE_DIRS templates TEMPLATE_DIRS
  • 97. filesystem.Loader TEMPLATE_DIRS templates TEMPLATE_DIRS
  • 98. Django Django 2
  • 99. admin/site_base.html … app_directory.Loader filesystem.Loader
  • 100. admin/site_base.html … app_directory.Loader filesystem.Loader
  • 119. ! <html> !!! <head>{% block title %} {% endblock title %}</head> <script type="text/javascript" src="common.js"></script> {% block custom_js %}{% endblock custom_js %} !!! <body> !!! <div id="menu">{% block menu %}{% endblock menu %}</div> !!! <div id="content">{% block content %}{% endblock content %}</div> <div id=”copyright”>{% block copyright %}everes{% endblock %}</div> !!! </body> ! </html> ! {% extends 'base.html% %} ! {% block title %}{{ block.super }} {% endblock title %} ! {% block menu %} {% endblock menu %} ! {% extends 'app/base.html' %} ! {% block content %} {% endblock content %}
  • 120. ! <html> !!! <head>{% block title %} {% endblock title %}</head> <script type="text/javascript" src="common.js"></script> {% block custom_js %}{% endblock custom_js %} !!! <body> !!! <div id="menu">{% block menu %}{% endblock menu %}</div> !!! <div id="content">{% block content %}{% endblock content %}</div> <div id=”copyright”>{% block copyright %}everes{% endblock %}</div> !!! </body> ! </html> ! {% extends 'base.html% %} ! {% block title %}{{ block.super }} {% endblock title %} ! {% block menu %} {% endblock menu %} ! {% extends 'app/base.html' %} ! {% block content %} {% endblock content %}
  • 121. ! <html> !!! <head>{% block title %} {% endblock title %}</head> <script type="text/javascript" src="common.js"></script> {% block custom_js %}{% endblock custom_js %} !!! <body> !!! <div id="menu">{% block menu %}{% endblock menu %}</div> !!! <div id="content">{% block content %}{% endblock content %}</div> <div id=”copyright”>{% block copyright %}everes{% endblock %}</div> !!! </body> ! </html> ! {% extends 'base.html% %} ! {% block title %}{{ block.super }} {% endblock title %} ! {% block menu %} {% endblock menu %} ! {% extends 'app/base.html' %} ! {% block content %} {% endblock content %}
  • 122. ! <html> !!! <head>{% block title %} {% endblock title %}</head> <script type="text/javascript" src="common.js"></script> {% block custom_js %}{% endblock custom_js %} !!! <body> !!! <div id="menu">{% block menu %}{% endblock menu %}</div> !!! <div id="content">{% block content %}{% endblock content %}</div> <div id=”copyright”>{% block copyright %}everes{% endblock %}</div> !!! </body> ! </html> ! {% extends 'base.html% %} ! {% block title %}{{ block.super }} {% endblock title %} ! {% block menu %} {% endblock menu %} ! {% extends 'app/base.html' %} ! {% block content %} {% endblock content %}