Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reusable Django Apps

Reusable Django Apps

A quick introduction for how to get started with making reusable Django apps.

TL;DR: Use https://github.com/pydanny/cookiecutter-djangopackage and you're ready to go.

Björn Andersson

September 04, 2014
Tweet

More Decks by Björn Andersson

Other Decks in Programming

Transcript

  1. @gaqzi What  is  a  reusable  app? • Models (pre 1.7

    this was what defined an app) • Views 2
  2. @gaqzi What  is  a  reusable  app? • Models (pre 1.7

    this was what defined an app) • Views • Templates 2
  3. @gaqzi What  is  a  reusable  app? • Models (pre 1.7

    this was what defined an app) • Views • Templates • Static assets 2
  4. @gaqzi What  is  a  reusable  app? • Models (pre 1.7

    this was what defined an app) • Views • Templates • Static assets • Configuration 2
  5. @gaqzi What  is  a  reusable  app? • Models (pre 1.7

    this was what defined an app) • Views • Templates • Static assets • Configuration • URLs (routes) 2
  6. @gaqzi What    makes  people  trust  your  app? • Documentation

    • How to use your app • How to install it 3
  7. @gaqzi What    makes  people  trust  your  app? • Documentation

    • How to use your app • How to install it • Requirements 3
  8. @gaqzi What    makes  people  trust  your  app? • Documentation

    • How to use your app • How to install it • Requirements • Tests 3
  9. @gaqzi What    makes  people  trust  your  app? • Documentation

    • How to use your app • How to install it • Requirements • Tests • Is your app green? 3
  10. @gaqzi How  to  make  a  reusable  app? Easiest way to

    start is to use cookiecutter. ! ! ! ! $ pip install cookiecutter $ cookiecutter [email protected]:pydanny/ cookiecutter-djangopackage.git !
  11. @gaqzi TravisCI  /    Continuous  Integration Travis can handle multiple

    versions of Python/Django for you as long as none of the packages differ. ! Meaning that if you only care about support 2.7, 3.3 you can use a Travis matrix to test your app. Which gives you nice output like this one.
  12. @gaqzi tox  /  Multi  version  testing Define which versions of

    Python you want to test with and which package versions on that given version. ! For instance to test Python 2.6 with Django 1.4, 1.5 and 1.6. Python 2.7 on Django 1.4, 1.5, 1.6 and 1.7 Python 3.3 on Django 1.6 and 1.7 ! Checkout tox-matrix for an easy way to define versions and dependencies.