Slide 1

Slide 1 text

@gaqzi Reusable  Django  Apps Björn Andersson 1

Slide 2

Slide 2 text

@gaqzi What  is  a  reusable  app? 2

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

@gaqzi What    makes  people  trust  your  app? 3

Slide 10

Slide 10 text

@gaqzi What    makes  people  trust  your  app? • Documentation 3

Slide 11

Slide 11 text

@gaqzi What    makes  people  trust  your  app? • Documentation • How to use your app 3

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

@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 !

Slide 17

Slide 17 text

@gaqzi starting  an  app  with  cookiecutter

Slide 18

Slide 18 text

@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.

Slide 19

Slide 19 text

@gaqzi Coveralls  /  Test  coverage

Slide 20

Slide 20 text

@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.

Slide 21

Slide 21 text

@gaqzi TravisCI  with  tox,  example  output 9

Slide 22

Slide 22 text

@gaqzi References • cookiecutter 
 https://github.com/audreyr/cookiecutter • cookiecutter-djangopackage 
 https://github.com/pydanny/cookiecutter-djangopackage • tox
 http://tox.testrun.org • tox-matrix
 https://pypi.python.org/pypi/tox-matrix