Blog / Software Development

How to delete all queues in RabbitMQ

January 21, 2018

I recently had to do this for one of my older Django projects that uses Celery as I made the mistake of using the broker as the result backend.

Using "amqp" as the result backend is not recommended in production as this will create a queue for each task. I noticed I was getting a warning for the file descriptors in the RabbitMQ web management dashboard.

From the web management (available by installing the management ...

How to use proxies with an HTTP session using the Python requests package

December 26, 2017

I was working on a client project yesterday where I needed to use a proxy to make HTTP requests with the Python requests package.

In my use case, I needed to create a session and I wanted to just specify the proxy settings in one place and use that for all requests made through that session. I didn't see how to do this in the documentation so I thought I'd share my solution ...

Using SSH Agent Forwarding with Ansible

December 24, 2017

I've been using SSH agent forwarding with Ansible for the last few projects I've been working on and I thought I'd just share my setup here.

The neat thing with SSH agent forwarding is not having to store your SSH keys on your servers when pulling down your Git repo during deployment.

For example, I can deploy new code to my servers through Ansible from my local machine using my local SSH ...

How to add full-text search to your Django app (with a PostgreSQL backend)

September 25, 2017

In Django 1.10, the module was added to make it really easy to use PostgreSQL's full text search engine with a Django app.

I currently use it for this blog, Remote Python's job and developer search, and our knowledge base for Highview Apps. I'm really impressed with how good the search is and how little code is needed to get it working. Unless you have huge amounts ...

Retry decorator for Python 3

September 1, 2017

When your app relies on making API calls to external resources, you should expect that there will be network issues from time to time and you should prepare for them.

While these will be rare relative to the number of requests you're making, handling them early on could really save you a lot of headache in the future as your app usage grows. Many of these things can be easily handled with a simple ...