Blog / Tech

Using Highcharts with Django 1.6 and Bootstrap 3

December 13, 2013

I was looking for a library to create charts to use for my Django app about a week ago and a friend suggested to try Highcharts as he had heard good things about it from fellow Python/Django developers.

Highcharts is a charting library purely written in JavaScript. The charts look really pretty and interactive. Using the library is quite easy, too, thanks to the well written documentation with lots of examples. You can view a …

Grouping data by field with the Django ORM

December 7, 2013

I just finished creating some charts for my Django app using Highcharts and had to group some data for them. I thought it would be just as simple as calling a group_by() method but turned out it works a little differently but still pretty straightforward and well documented.

Just to show an example (I’m using Django 1.6):

# glucoses/models.py

class Category(models.Model):
    name = models.CharField(unique=True, max_length=255)


class Glucose(TimeStampedModel):
    user = models.ForeignKey(User)
    value = models.PositiveIntegerField() # …

Auto-deploy your Django app to Heroku with Travis CI on git push

December 3, 2013

I was setting up a demo site for my latest open-source project, GlucoseTracker, a few weeks back and decided to run it on Heroku. The free tier (called ‘Hobby Dev’) allows 10,000 rows in a PostgreSQL database and 20 concurrent connections, which is more than good enough for me at this point.

I thought about using Jenkins CI to do the deployment to Heroku initially, but as I was installing it on my …

AT&T GoPhone: How to get the 10 cents/minute plan with your smartphone

November 29, 2013

I just recently came back to the US and had to get a new SIM card (which you can get on Amazon for about $0.25+shipping (should come out to less than $2), a lot cheaper than the $10 AT&T charges). I don’t want to subscribe to their plans that give you unlimited voice or text messaging as I rarely use my cellphone service. I really just want to have it in case of an emergency. …

Loading dummy data for your Django app using management commands

November 23, 2013

I’m at a point in my project now, GlucoseTracker, a web application for keeping tracking of blood sugar levels, where I’m starting to work on reporting and statistics. I need some dummy data automatically loaded in the database to work on this part and I need to refresh the data every few days or so.

It would be too much work to do this manually so I wrote a simple script that would be …