D JANGO Leo Wang Daniel South Philip Kim
Introduction Open Source web application framework Released in 2005 Python is used throughout Speed of development
Django vs Rails Similarties: – Django is to Python as Rails is to Ruby – Model-View-Controller architectural – Emphasis is on Reuse, DRY and simplicity Differences: – Django has a built-in admin control whereas Rails doesn’t
Django Community
Rails Community
Common Uses Dynamic web pages – Guestbook – Poll voting – Forum – Social network
Features Session Framework – Store visitor data – Python dictionary Templates – Generate unique views – Built-in tags
Features Django admin interface – Designed for nontechnical users – User interface to perform tasks
Format Django Models Controller Python code Views.py Views Templates folder Html code Rails Models Controller Ruby code controller.rb Views Views folder html
Django Model Database Class function
Controller views.py forms.py urls.py tasks_list = Task.objects.filter(deleted=False).exclude().exclude().filter() task = Task.objects.get(id=1, deleted=False) url(r'^tasks/$', 'example.tasks.views.task_list')
Views Template folder Template tags Load, block, extend include {% load “....html” %} {{task.get_till_due|get_date}} {% if some_condition %} {% for some_iterator %} {{form.title.label}} {{form.title}}
Example 3974 ish?