RalphLepore.net


Debugging Django Management Commands with strace

This past week I ran into an issue where a django management command running on a cron began to hang.   I began to rollback changes to the environment, downgrading python versions, downgrading postgresql versions and even rebuilding the application in another region on Digial Ocean.  None of this seemed to work.  My initial hypothisis was that there was a bug in the managem…

Read More...


Django Constraints

As of Django 2.2, you can add database constraints to your models.  I find database constraints extremely valuable and one of those few features that Django really needed.

This blog post is more of a quick reference for myself when adding constraints to my Django models

Django has support for both CheckConstraints and UniqueConstraints.&n…

Read More...


Term-centric search using Elasticsearch and Django

Recently I've been working on a side project that has a search component at it's core. I'm pulling a set of data from an external source, loading it into my database and pushing the data to Elasticsearch. There are a handful of fields that I need to search over and I wanted to do a google style search (single search bar) rather than a faceted search. This means I have to search for…

Read More...


Custom Foreign Key Constraints with Django

The current project I'm working on has database tables that are over 2 million records which I'm populating from an external source. The external source provides a postgres dump file to help make data imports easier.

My current approach is to restore the backup to a temporary database and use the PostgreSQ…

Read More...


Django 1.8 Template

This past weekend I decided to build a django template for future projects. I've recently started to work on a new project and realized I'm spending far to much time building out my django project layout. Since Django 1.8 recently came out I felt it would be a good time to buid a resuable project template. This project is a mix of Read More...