• Adding labels to Ember Leaflet markers

    This post shows you how to create a custom marker component that integrates the Leaflet.label add-on to get nice pop-up labels on your ember-leaflet maps.

  • Django access mixin for active users only

    As of Django 1.9, there are a number of new permission mixins you can use with your views to make access control easier. One that isn't included by default is a mixin allowing you to only permit users who have activated their account (user.is_active = True)

  • Updating your cert_fingerprint for offlineimap with Fastmail.fm

    Fastmail recently updated their SSL certificate, breaking my offlineimap email backups. This post has the updated cert_fingerprint value you need to add to get it back running

  • The Missing Manager for Django Models with GFK Relationships

    Save yourself writing the same queries time and time again by creating a simple model manager with common queries for your generic foreign keys

  • Importing Big Databases with MAMP & phpMyAdmin on OSX

    When you are using phpMyadmin on MAMP or MAMP Pro out of the box, you might run into trouble trying to import large databases due to PHP's default upload and timeout settings. This post explains the quick-fix needed to get it working.

  • Uploading and validating an image from an URL with Django

    This post outlines a simple Django app that allows the user to upload an image via an URL while making sure the image file is valid.

  • Understanding, setting up, accessing and serving media files and static files in Django

    One of my most popular Stackoverflow answers is to a question regarding the confusion between static and media files in Django. This post elaborates on that theme.

  • An Updated General Django Project Structure or Folder Layout

    In a previous post I outlined a sane folder structure for a new Django project. Since then Django 1.5 (and 1.6) has been released along with an updated default folder structure. This post goes through some further tips on keeping your django project layout sensible.

  • Autodeploy Jekyll using bitbucket post-commit service hooks and Flask

    A very nice and clean way to deploy a Jekyll (or any other static generated site) is to setup a very small application on your sites webserver to listen for post commit hooks from Bitbucket. This allows you to have your site automatically updated and regenerated every time you push to your repository. This post shows you how.

  • SuspiciousOperation Invalid HTTP_HOST header with Django

    I was recently getting this error while trying to deploy a new project to production. It turns out that due to a recent security update, you need to make sure that the incoming host name in your request is valid.