#django Articles


A Django custom command to write model fields on an Excel file

Suppose you need to write down your model fields on an Excel file, for example to complement the documentation of your code. Django has built in functions to introspect models and fields of an app, and you can leverage this API to have the information you need. You can use …

A simple Python email gateway

Say you have a Django web application that you want to integrate with emails to make it possibile to send data and files to your web application over SMTP. The good news is that Python has a simple SMTP daemon in the standard library, together with modules to parse emails …



  • Wed 18 May 2016
  • web

How to migrate your existing Django project to Heroku

Recently I had some fun with Heroku, the well known PaaS provider. I had a small personal Django project I use for invoicing that I ran locally with ./manage.py runserver when needed. That was a perfect candidate for the Heroku free plan because I need to access the app …

A simple script to update a DB migration in Django 1.7+

During the development of a Django model on your local machine is it often necessary to refine the most recent migration to cope with updates to the model, without polluting the migrations of the app with a new migration for each local update. South had the update flag for the …

  • Wed 10 September 2014
  • web

How to add a group choice combo box in a Django user profile form

Assume that you have a Django project where each user belongs to just one group, say Registered or Admin, but not both. You want to show a form in your front-end to let Admin users edit the user profiles, where each user profile is made with First name, Last name …