Django Round-Up #9

Happy May and welcome to Django Round-up #9! I have a special request for you, so please check the bottom of the email before clicking the “archive” button.

Django Software Foundation call for board nominations

Alex Gaynor is stepping down from the DSF board to serve as a director of the Python Software Foundation. The DSF is looking for nominees to take the vacated spot. If you know someone that would be a good fit, get in touch!

DjangoSCUBA

We mentioned it in issue #7, but they are back with more info and it looks like it is really going to happen. If you’re a diver and are interested in spending a week at the Red Sea in early 2014, sign up now. From the looks of it the trip is already half-full.

Managing Django Translations with Transifex

A nice walk-through by Mark Lavin over at Caktus Group about how to use Transifex to handle internationalizing your Django app. If i18n is still foreign to you, check out Jacob Burch’s talk from DjangoCon last year on the subject.

Git post-checkout hook for Python repos

I think every Python developer has been bitten by orphaned .pyc files in the past. Use this hook to blow them away on every checkout. Check out the comments for an environment variable trick to wipe them out for good (locally).

Converting unittests to pytest-django

Django’s test discovery is pretty naïve compared to what’s available in py.test. This post shows how to setup your project to use py.test instead, giving you more flexibility with where your tests live and how they are named.

Per-user Python Logs

Here’s a clever snippet that allows you to attach a user object (or whatever object really) to your log output. This would be useful for following up with users on errors, metrics tracking, or providing a history to track in the case of a misbehaving visitor.

Disabling Database Access from your Django Unit Tests

David Winterbottom extends an idea from a talk by Carl Meyer on how to ensure the code covered by certain tests aren’t hitting the database. Useful to know that extra database requests aren’t being made where they shouldn’t.

Serving Django and Twisted using HAproxy

This setup lets them handle a traditional web app (Django) and a websockets service (Twisted) via the same port and IP. It’s pretty much a full dump of their server, including setup details and config files.

Filepicker.io and South

Daniel Greenfeld shows how he extended a reusable app (django-filepicker) with custom fields to make it compliant with South. All without modifying a line of code in the original package.

POST-only fields in Django REST framework

Extending Django REST Framework’s ModelSerializer class to allow for additional fields that are only used for processing and not actually saved back to the model.

Django and Modular JavaScript

Moving from a “traditional” Django project to a JavaScript application backed by Django requires some changes to the way you structure your code. This post takes the reader through that author’s journey doing just that.

Django Marcador

A free and open source Django Tutorial starting from the basics. Originally in German and now translated to English.

New & Updated Packages

Django Jobs

That’s it for this week, but I did tell you I have a special request. I think these newsletters are really helpful and I’d like more people to see them.