SlideShare a Scribd company logo
1 of 43
Django Web Framework 김형용, 이정민 Framework 2.1
Django ,[object Object],[object Object],[object Object],[object Object]
History ,[object Object],[object Object],[object Object],[object Object],[object Object]
“ Django”  어떻게 읽어요 ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Installation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Install Python ,[object Object],[object Object],[object Object],[object Object],[object Object]
Install SQLite3, pysqlite 2 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Install Django (0.95) ,[object Object],[object Object],[object Object],[object Object]
Tutorial
Project (site) :  framework21 Database Application : admin Application : admin Application : admin /admin/ Application :  blog /blog/ Application :  phonebook /phonebook/
startproject ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],RoR Django
startapp ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],RoR
Create Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activating model(Application) ,[object Object],[object Object]
Play with Model API ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
admin interface. ,[object Object],[object Object],[object Object],[object Object],[object Object]
URL design ,[object Object],[object Object],[object Object],[object Object]
View ,[object Object],[object Object],[object Object]
Stub view ,[object Object],[object Object],[object Object],[object Object],[object Object]
Template ,[object Object]
Template ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
URL Resolver
URL Resolver blog/urls.py urlpatterns = patterns(‘blog.views', … (r'^blog/$',  ‘post_list'), (r'^blog/new/$',  ‘post_new'), (r'^blog/(?P<post_id>+)/$', ‘post_detail'), …
URL Resolver blog/urls.py urlpatterns = patterns(' blog.views ', … (r'^blog/$',  ‘post_list'), (r'^blog/new/$',  ‘post_new'), (r'^blog/(?P<post_id>+)/$' , ‘post_detail'), …
URL Resolver blog/urls.py urlpatterns = patterns( ' blog.views ' , … (r'^blog/$',  ‘post_list'), (r'^blog/new/$',  ‘post_new'), (r'^blog/(?P<post_id>+)/$',  ‘post_detail'), … blog.views.post_detail view
URL Resolver blog/urls.py urlpatterns = patterns( ' blog.views ', … (r'^blog/$',  ‘post_list'), (r'^blog/new/$',  ‘post_new'), (r'^blog/ (?P<post_id>+) /$',  ‘post_detail'), … blog.views.post_detail(post_id=‘2’) view
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) … blog.views.post_detail(post_id=‘2’)
URL Resolver view blog/views.py def post_detail(request, post_id): post =  Post.objects.get(pk=post_id) … model
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) … Django template blog/templates/blog_detail.html
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) … Django template blog/templates/blog_detail.html
URL Resolver view blog/templates/blog_detail.html <h1> {{  post .title }} </h1> <p> {{ post.content|restructuredText }} </p> Comments: <ul> {% for comment in post.comments %} <li> {{ comment.who }}: {{ comment.content }} </li> {% endfor %} </ul> Django template Context({‘post’: post})
URL Resolver view blog/templates/blog_detail.html <h1> {{ post.title }} </h1> <p> {{ post.content|restructuredText }} </p> Comments: <ul> {% for comment in post.comments %} <li> {{ comment.who }}: {{ comment.content }} </li> {% endfor %} </ul> Django template <h1>  여자친구 구함  </h1> <p> 20 세 이상 신체건강한 대한민국… </p> Comments: <ul> <li>  이정민 :  좋은 결과 있길바랍니다 . </li> </ul>
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html)
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html) OR
URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html) def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) return render_to_response(‘blog_detail.html’, {‘post’: post}) OR
 
URL Resolver view Django template model
Where is MIDDLEWARE? URL Resolver view Django template model mid.process_request(request) mid.process_view(request, view_func, view_args, view_kwargs) mid.process_response(request, response)
Server arrangement ,[object Object],[object Object],[object Object],[object Object],[object Object]
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object]
이런저런 이야기 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Getting Involved ,[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django Developers
Christine Cheung
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
DjangoCon2008
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
Jacob Kaplan-Moss
 
Django Framework and Application Structure
Django Framework and Application StructureDjango Framework and Application Structure
Django Framework and Application Structure
SEONGTAEK OH
 

What's hot (20)

Django by rj
Django by rjDjango by rj
Django by rj
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
Rest api with Python
Rest api with PythonRest api with Python
Rest api with Python
 
Web application development with Django framework
Web application development with Django frameworkWeb application development with Django framework
Web application development with Django framework
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Django tech-talk
Django tech-talkDjango tech-talk
Django tech-talk
 
Django REST Framework
Django REST FrameworkDjango REST Framework
Django REST Framework
 
Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django Developers
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwal
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Django Framework and Application Structure
Django Framework and Application StructureDjango Framework and Application Structure
Django Framework and Application Structure
 
API Design & Security in django
API Design & Security in djangoAPI Design & Security in django
API Design & Security in django
 
Ant
Ant Ant
Ant
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Free django
Free djangoFree django
Free django
 

Viewers also liked

Viewers also liked (8)

mic06-jay-prezentacija
mic06-jay-prezentacijamic06-jay-prezentacija
mic06-jay-prezentacija
 
02-11-05
02-11-0502-11-05
02-11-05
 
Harvard
HarvardHarvard
Harvard
 
konane-talk
konane-talkkonane-talk
konane-talk
 
finance
financefinance
finance
 
socialnetworking
socialnetworkingsocialnetworking
socialnetworking
 
ONA_Dornisch_GAO
ONA_Dornisch_GAOONA_Dornisch_GAO
ONA_Dornisch_GAO
 
bio-intro
bio-introbio-intro
bio-intro
 

Similar to Django

Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
fool2nd
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
Peter Wilcsinszky
 

Similar to Django (20)

Django
DjangoDjango
Django
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
 
Django
DjangoDjango
Django
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
 
Django O/R Mapper
Django O/R MapperDjango O/R Mapper
Django O/R Mapper
 
Meetup django common_problems(1)
Meetup django common_problems(1)Meetup django common_problems(1)
Meetup django common_problems(1)
 
Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Django Vs Rails
Django Vs RailsDjango Vs Rails
Django Vs Rails
 
PyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven DevelopmentPyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven Development
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 

More from webuploader

Michael_Hulme_Banff_Social_Networking
Michael_Hulme_Banff_Social_NetworkingMichael_Hulme_Banff_Social_Networking
Michael_Hulme_Banff_Social_Networking
webuploader
 
cyberSecurity_Milliron
cyberSecurity_MillironcyberSecurity_Milliron
cyberSecurity_Milliron
webuploader
 
LiveseyMotleyPresentation
LiveseyMotleyPresentationLiveseyMotleyPresentation
LiveseyMotleyPresentation
webuploader
 
FairShare_Morningstar_022607
FairShare_Morningstar_022607FairShare_Morningstar_022607
FairShare_Morningstar_022607
webuploader
 
3_System_Requirements_and_Scaling
3_System_Requirements_and_Scaling3_System_Requirements_and_Scaling
3_System_Requirements_and_Scaling
webuploader
 
ScalabilityAvailability
ScalabilityAvailabilityScalabilityAvailability
ScalabilityAvailability
webuploader
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
webuploader
 
7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit
webuploader
 
FreeBSD - LinuxExpo
FreeBSD - LinuxExpoFreeBSD - LinuxExpo
FreeBSD - LinuxExpo
webuploader
 

More from webuploader (20)

Michael_Hulme_Banff_Social_Networking
Michael_Hulme_Banff_Social_NetworkingMichael_Hulme_Banff_Social_Networking
Michael_Hulme_Banff_Social_Networking
 
socialpref
socialprefsocialpref
socialpref
 
cyberSecurity_Milliron
cyberSecurity_MillironcyberSecurity_Milliron
cyberSecurity_Milliron
 
PJO-3B
PJO-3BPJO-3B
PJO-3B
 
LiveseyMotleyPresentation
LiveseyMotleyPresentationLiveseyMotleyPresentation
LiveseyMotleyPresentation
 
FairShare_Morningstar_022607
FairShare_Morningstar_022607FairShare_Morningstar_022607
FairShare_Morningstar_022607
 
saito_porcupine
saito_porcupinesaito_porcupine
saito_porcupine
 
3_System_Requirements_and_Scaling
3_System_Requirements_and_Scaling3_System_Requirements_and_Scaling
3_System_Requirements_and_Scaling
 
ScalabilityAvailability
ScalabilityAvailabilityScalabilityAvailability
ScalabilityAvailability
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit
 
Chapter5
Chapter5Chapter5
Chapter5
 
Mak3
Mak3Mak3
Mak3
 
visagie_freebsd
visagie_freebsdvisagie_freebsd
visagie_freebsd
 
freebsd-watitis
freebsd-watitisfreebsd-watitis
freebsd-watitis
 
BPotter-L1-05
BPotter-L1-05BPotter-L1-05
BPotter-L1-05
 
FreeBSD - LinuxExpo
FreeBSD - LinuxExpoFreeBSD - LinuxExpo
FreeBSD - LinuxExpo
 
CLI313
CLI313CLI313
CLI313
 
CFInterop
CFInteropCFInterop
CFInterop
 
WCE031_WH06
WCE031_WH06WCE031_WH06
WCE031_WH06
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Django

  • 1. Django Web Framework 김형용, 이정민 Framework 2.1
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10. Project (site) : framework21 Database Application : admin Application : admin Application : admin /admin/ Application : blog /blog/ Application : phonebook /phonebook/
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.  
  • 24. URL Resolver blog/urls.py urlpatterns = patterns(‘blog.views', … (r'^blog/$', ‘post_list'), (r'^blog/new/$', ‘post_new'), (r'^blog/(?P<post_id>+)/$', ‘post_detail'), …
  • 25. URL Resolver blog/urls.py urlpatterns = patterns(' blog.views ', … (r'^blog/$', ‘post_list'), (r'^blog/new/$', ‘post_new'), (r'^blog/(?P<post_id>+)/$' , ‘post_detail'), …
  • 26. URL Resolver blog/urls.py urlpatterns = patterns( ' blog.views ' , … (r'^blog/$', ‘post_list'), (r'^blog/new/$', ‘post_new'), (r'^blog/(?P<post_id>+)/$', ‘post_detail'), … blog.views.post_detail view
  • 27. URL Resolver blog/urls.py urlpatterns = patterns( ' blog.views ', … (r'^blog/$', ‘post_list'), (r'^blog/new/$', ‘post_new'), (r'^blog/ (?P<post_id>+) /$', ‘post_detail'), … blog.views.post_detail(post_id=‘2’) view
  • 28. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) … blog.views.post_detail(post_id=‘2’)
  • 29. URL Resolver view blog/views.py def post_detail(request, post_id): post = Post.objects.get(pk=post_id) … model
  • 30. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) … Django template blog/templates/blog_detail.html
  • 31. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) … Django template blog/templates/blog_detail.html
  • 32. URL Resolver view blog/templates/blog_detail.html <h1> {{ post .title }} </h1> <p> {{ post.content|restructuredText }} </p> Comments: <ul> {% for comment in post.comments %} <li> {{ comment.who }}: {{ comment.content }} </li> {% endfor %} </ul> Django template Context({‘post’: post})
  • 33. URL Resolver view blog/templates/blog_detail.html <h1> {{ post.title }} </h1> <p> {{ post.content|restructuredText }} </p> Comments: <ul> {% for comment in post.comments %} <li> {{ comment.who }}: {{ comment.content }} </li> {% endfor %} </ul> Django template <h1> 여자친구 구함 </h1> <p> 20 세 이상 신체건강한 대한민국… </p> Comments: <ul> <li> 이정민 : 좋은 결과 있길바랍니다 . </li> </ul>
  • 34. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html)
  • 35. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html) OR
  • 36. URL Resolver view blog/views.py def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) t = loader.get_template(‘blog_detail.html’) c = Context({‘post’: post}) html = t.render(c) return HttpResponse(html) def post_detail(request, post_id): post = Blog.objects.get(pk=post_id) return render_to_response(‘blog_detail.html’, {‘post’: post}) OR
  • 37.  
  • 38. URL Resolver view Django template model
  • 39. Where is MIDDLEWARE? URL Resolver view Django template model mid.process_request(request) mid.process_view(request, view_func, view_args, view_kwargs) mid.process_response(request, response)
  • 40.
  • 41.
  • 42.
  • 43.