DjangoCon 2015 notes

Here is a quick set of notes from my recent trip to DangoCon Europe 2015.


Coding talk

There was a bit of discussion about best place to put your app’s business logic – either in the django-recommended model manager or in a service layer component

Either way never write to a model field or call save() directly in a view – a good blog post on why:

git-crypt might be worth a look if you ever want to store secrets in github.

Suggested preference to import models over classes and remove unneeded labelling in the process
e.g. favouring
import view

from view import LoginView

Lots of talk around Django as headless server & Microservices architecture – see Martin Fowler’s recent blog post on the subject:


Python 3 talk

Probably worth always adding following imports when creating new python files:
from __future__ import absolute_import, division, print_function

And this neat utility:
pip install caniusepython3
caniusepython3 -r requirements.txt


Testing talk

Check out hypothesis – a nice python-based fuzz tester for unit tests

Nose is dead, long live py.test! py.test is actively maintained, has nicer output, more pythonic assert statements, ability to tag slow tests and rerun only failing tests. Will work with Django’s TestClient but might need to do some work to migrate existing nose tests.

django-test-plus – a nice wrapper around reverse and other useful utils


Services talk – monitors your requirements.txt for updated packages and security fixes. Free to public github repos. – aims to fill the middle ground between Sentry and NewRelic