SlideShare a Scribd company logo
gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩
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
…   …
gumiStudy#3 Django – 次の一歩
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
gumiStudy#3 Django – 次の一歩
admindoc
              Django
       view
                       Django BIDI
gumiStudy#3 Django – 次の一歩
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
gumiStudy#3 Django – 次の一歩
gumiStudy#3 Django – 次の一歩
models
models.py
models
models.py
…
models   import   models
                       meta       app_label
…
models   import   models
                       meta       app_label
gumiStudy#3 Django – 次の一歩
…


                        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
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 – 次の一歩
! <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 %}
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 Django – 次の一歩

More Related Content

PDF
Google Guava & EMF @ GTUG Nantes
PDF
Dynamic Analysis (EVO 2008)
PDF
How to discover the Ruby's defects with web application
PDF
IronSmalltalk
PPTX
Android & Kotlin - The code awakens #01
ODP
Pysmbc Python C Modules are Easy
PDF
Understanding the Dalvik bytecode with the Dedexer tool
PDF
Nikita Popov "What’s new in PHP 8.0?"
Google Guava & EMF @ GTUG Nantes
Dynamic Analysis (EVO 2008)
How to discover the Ruby's defects with web application
IronSmalltalk
Android & Kotlin - The code awakens #01
Pysmbc Python C Modules are Easy
Understanding the Dalvik bytecode with the Dedexer tool
Nikita Popov "What’s new in PHP 8.0?"

What's hot (20)

PDF
Invokedynamic / JSR-292
PDF
djangoic approach to implement common web development paradigms
PDF
Annotation Processing
PDF
Testing untestable code - ConFoo13
PDF
Recommending Method Invocation Context Changes
PPTX
Hacking for fun and for profit
PDF
Running Pharo on the GemStone VM
PDF
Inc0gnito 2015 Android DEX Analysis Technique
PDF
Clean coding-practices
PPTX
Introduction to javascript and yoolkui
PDF
ZF2 Presentation @PHP Tour 2011 in Lille
PDF
Testing untestable code - IPC12
KEY
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
PPT
Invoke dynamics
KEY
groovy & grails - lecture 7
PDF
Building DSLs with Xtext - Eclipse Modeling Day 2009
ODP
Method Handles in Java
PDF
Groovy 2.0 webinar
PDF
Shark
PDF
Framework Engineering Revisited
Invokedynamic / JSR-292
djangoic approach to implement common web development paradigms
Annotation Processing
Testing untestable code - ConFoo13
Recommending Method Invocation Context Changes
Hacking for fun and for profit
Running Pharo on the GemStone VM
Inc0gnito 2015 Android DEX Analysis Technique
Clean coding-practices
Introduction to javascript and yoolkui
ZF2 Presentation @PHP Tour 2011 in Lille
Testing untestable code - IPC12
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Invoke dynamics
groovy & grails - lecture 7
Building DSLs with Xtext - Eclipse Modeling Day 2009
Method Handles in Java
Groovy 2.0 webinar
Shark
Framework Engineering Revisited
Ad

Viewers also liked (6)

PDF
gumiStudy#4 mixiアプリのスマートフォン版について
KEY
gumiStudy#2 実践 memcached
PDF
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
PDF
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
PDF
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
PPT
A geek's guide to getting hired
gumiStudy#4 mixiアプリのスマートフォン版について
gumiStudy#2 実践 memcached
gumiStudy#1 ソーシャルアプリにおけるKVSの利用事例
gumiStudy#5 JavaScript でネイティブiPhone/Androidアプリを作る
gumiStudy#1 キーバリューストアのご紹介と利用時の設計モデルについて
A geek's guide to getting hired
Ad

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

KEY
國民雲端架構 Django + GAE
PDF
The Best (and Worst) of Django
KEY
Developing With Django
PDF
django_reference_sheet
PDF
Introduction To Django (Strange Loop 2011)
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
國民雲端架構 Django + GAE
The Best (and Worst) of Django
Developing With Django
django_reference_sheet
Introduction To Django (Strange Loop 2011)
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

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Machine Learning_overview_presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectroscopy.pptx food analysis technology
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine Learning_overview_presentation.pptx

gumiStudy#3 Django – 次の一歩

  • 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 %}