learning web development with django - guestbook

13
Add the guestbook to every post 4/18/2015

Upload: hsuan-wen-liu

Post on 25-Jan-2017

607 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Learning Web Development with Django - Guestbook

Add the guestbook to every post

4/18/2015

Page 2: Learning Web Development with Django - Guestbook

Workflow

Models

Forms

Views

Templates

Page 3: Learning Web Development with Django - Guestbook

mysite —— mysite —— __init__.py | |— local_settings.py | |— settings.py | |— urls.py | |— wsgi.py |— template —— home.py | |— post.html | |— msg_add.html | |— msg_post.html |— trips —— __init__.py | |— admin.py | |— forms.py | |— models.py | |— tests.py | |— views.py

— modified— add

Page 4: Learning Web Development with Django - Guestbook

/ trips/ models.py

Page 5: Learning Web Development with Django - Guestbook

/ trips/ admin.py

http://127.0.0.1:8000/admin/

Page 6: Learning Web Development with Django - Guestbook

/ trips/ forms.py

Page 7: Learning Web Development with Django - Guestbook

/ templates/ msg_add.html

/ templates/ post.html

Page 8: Learning Web Development with Django - Guestbook
Page 9: Learning Web Development with Django - Guestbook

/ templates/ msg_post.html

/ templates/ post.html

Page 10: Learning Web Development with Django - Guestbook
Page 11: Learning Web Development with Django - Guestbook

/ trips/ Views

Page 12: Learning Web Development with Django - Guestbook

CSRF (Cross Site Request Forgery)

Page 13: Learning Web Development with Django - Guestbook

HsuanWen Liu

“Thank you.”