Blog

Django Tip: How to configure Gunicorn to auto-reload your code during development

March 30, 2014

I just finished fully automating my entire server stack for my Django app with Ansible and Vagrant (using VirtualBox). One of the reasons I did this is to make my development environment as close to production as possible to hopefully eliminate any surprises when deploying to production. It also allows me to setup a development environment very quickly as I won’t have to deal with manual installation and configuration of different packages. In a team …

How to find out which web server a website is using with Telnet

March 24, 2014

Here’s a quick and easy way to figure out what kind of web server a website is using with good, old telnet. I like this method as most operating systems (both old and new versions) have a telnet client already installed.

Steps:

1. Open a command/terminal window.

2. Telnet to the server/website on port 80, e.g.

telnet www.glucosetracker.net 80

3. Type the following once you’re connected:

HEAD / HTTP/1.0

4. Hit the Enter key …

Living in Barcelona, Spain

February 9, 2014

I knew a few months ahead of time that I’ll be ending my round-the-world trip in Barcelona, Spain. The main reasons being that airfare from Barcelona to New York is fairly low compared to other cities and I was told that weather here is still great through late October. Barcelona is also known to be a very lively city with lots of things going on every day and a good place to meet people from …

Deploying your Django app with Fabric

January 25, 2014

I’ve been making quite a bit of improvements and changes to my Django app, GlucoseTracker, lately that the small amount of time I spent creating a deployment script using Fabric had already paid off.

Fabric is basically a library written in Python that lets you run commands on remote servers (works locally as well) via SSH. It’s very easy to use and can save you a lot of time. It eliminates the need to …

A simple Python script for backing up a PostgreSQL database and uploading it to Amazon S3

January 10, 2014

Here’s a very simple Python script I currently use to create a compressed PostgreSQL database backup for my Django app. Since my database is very small and I don’t see it becoming big anytime soon, I create the backup locally and send a copy to Amazon S3.

To keep it very simple, I have it set to do hourly backups for 24 hours and daily backups for 1 year (365 days). For the hourly …