Change the future

Wednesday 1:20 p.m.–4:40 p.m.

Effective Django

Nathan Yergler

Audience level:
Novice
Category:
Web Frameworks

Description

Django is a popular, powerful web framework for Python. It has lots of "batteries" included, and makes it easy to get started. But all of the power means you can write low quality code that still works. Effective Django means building applications that are testable, maintainable, and scalable. This tutorial will introduce attendees to Django with an emphasis on testing, maintenance, and scale.

Abstract

Django is a popular, powerful web framework for Python. It has lots of "batteries" included, and makes it easy to get up and going. But all of the power means you can write low quality code that still seems to work. Effective Django development means building applications that are testable, maintainable, and scalable -- not only in terms of traffic or load, but in terms of being able to add developers to projects. This tutorial will introduce attendees to Django with an emphasis on best practices, testing, maintenance, and scalability.

Central to effective Django development is a mental model of what different pieces are "supposed" to do:

  • Views -- Convert Request to Response
  • Forms -- Convert input to Python objects
  • Models -- Encapsulate data and business logic

As we walk through building an application, this model will be used to help reinforce what makes something testable, maintainable, and scalable.

Particular attention will be paid to features introduced in the last two releases which casual developers may not be aware of, but which can make them much more effective when using Django. This includes class based views, testing tools, and ORM changes.

Topics covered will include:

  • best practices for code organization and dependency management
  • class based views
  • unit tests, the test client, and request factory
  • the ORM and new additions in recent releases
  • use of forms

Update: See updated tutorial preparation instructions at Effective Django