Install PyQt in a virtualenv with Pip

Noticed that pip install pyqt isn't working? At least at the time of writing this blog it isn't..

This is the error that I got:
IOError: [Errno 2] No such file or directory: setup.py

It seems they didn't package it well and it's using configure ...

more ...




Only use worker when required on heroku with Django/Python

For a mobile project I required a background worker which sents an email with 300 generated QR codes zipped together as attachment. This costs quite some time so we need a background worker to execute this task.

I wanted to achieve the following result:

  • When the user wants to generate ...
more ...


Django Custom View Decorator with Arguments

To make my life easier I made a simple decorator which checks if the parameters are present in the request.POST or request.GET and returns a response if they are not.

It accepts a list of parameters in string format and will loop through each parameter to check if ...

more ...

Simple function to return json in Django

Just a small code snippet I use when I need to return json, comments are welcomed.

from django.http import HttpResponse  
from django.utils import simplejson as json

def json_response(dict_to_convert_to_json):  
    return HttpResponse(json.dumps(dict_to_convert_to_json),
                        mimetype="application/json")

To use it in your view you just do it this ...

more ...