Saturday 11:15 a.m.–11:45 a.m.

Writing, Publishing and Maintaining Reusable Django Apps

Martin Brochhaus

Audience level:
Intermediate
Room:
Lecture Room E2

Description

This talk shows best practices for how to create reusable Django apps. You will learn how to structure your app, how to host it on Github and publish it on the Python Package Index. I will show how you can write your app in a test driven manner (TDD) even though you are developing it outside of any specific Django project.

Abstract

During the last two years I have released about 60 reusable Django apps (see Github). In the beginning this was a frustrating experience because I had to learn how to publish and maintain packages on the Python Package Index and how to structure the app so that it can be developed with Test Driven Development even though it is not part of an actual Django project.

After we learned our lessons, the process of writing reusable Django apps has become a no brainer and I would like to share how this process goes:

Introduction:

  • What are reusable apps?
  • Why should you use reusable apps?
  • How to use a typical reusable app?

Workflow:

  • Structure your app
  • Execute tests before you write code
  • Serve app specific static files and templates
  • Maintain app specific Django settings
  • Ship South migrations
  • Preview your app in a browser
  • Add documentation
  • Publish the app on pypi.python.org
  • Writing your MANIFEST.in file

Hints and tips

  • Include a license
  • Encourage contributors
  • Use travis.ci for continuous integration testing
  • Host documentation on readthedocs.org