Blog / Tech

Django 1.8 Project Template

April 12, 2015

Yup, that's right, another Django project template!

I know there's a ton of these projects already on GitHub, but as I was in the process of rewriting an old Django project last week, I found out that Django 1.8 just came out. I figured this is a good opportunity to create another one I could use for future projects as I already have a few small ones in mind. Django 1.8 is also an …

Creating a simple 'Reading List' app in Django with Amazon's Product Advertising API

April 2, 2015

I had been using Shelfari for a few years to keep track of books I've read and plan to read. I really liked the website's interface and they had this nice widget that lets you display a bookshelf of your reading list on your blog. But when I forced SSL on my blog, it stopped working. The widget doesn't work over https.

I then looked for other widgets and tried Amazon's widget. But their widget …

Solr request returning a 400 (Bad Request) response

March 26, 2015

I was troubleshooting an issue for a client the other day where certain Solr requests were returning a 400 (Bad Request) error response. There were actually 2 separate issues:

1. The Tomcat servlet and/or the web server in front of it (in this case an HA Proxy server) can't process the request because it's too big.

2. The Solr query parameter contains too many boolean clauses (the error actually says 'too many boolean clauses').

To …

Installing hub (git wrapper) on Ubuntu the easy way

February 26, 2015

This is more a "note to self" in case I need to do this again.

We use hub at work mainly to convert GitHub issues to pull requests. For Mac users, you can install it by simply typing in brew install hub. But for Linux users, the installation is a little bit more complicated.

Below is the easy way to do it:

sudo apt-get install ruby
sudo curl https://hub.github.com/standalone -Lo /usr/bin/hub
sudo chmod 755 …

Give your Django app more of a native mobile app feel with Chrome for Android's 'Add to Homescreen'

February 10, 2015

A user of one of my Django apps, GlucoseTracker, suggested this to me last week and I actually didn't even know this feature existed. I thought it was a really great idea and it turned out it can be done easily with about 3 lines of additional code:

# base.html

<!doctype html> 
<html>
   <head>
     <title>GlucoseTracker</title>

      <!-- Enables 'Add to Homescreen' for Android -->
      <meta name="viewport" content="width=device-width">
      <meta name="mobile-web-app-capable" content="yes">
      <link rel="icon" sizes="192x192" href="{% static …