Quick tip: Adding Variables to env in a Virtualenv (for development purpose)

Thursday, 16 July 2015

If you're working with third party APIs, you might find code like YOUR_SECRET_KEY="some secret api key" in your source code, this is a bad practices for a lot of reasons (security, source code sharing, etc). Instead, the recommended way to manage this kind of situation is to add the value as a enviroment variable, and read it in your code with something like this:

import os

So, how do you avoid to add the ...

Debian (development tips)

Saturday, 13 December 2014

These are some extra steps that I've found necessary when starting development in a recently-installed Debian machine.

Jpeg support in PIL and pillow.

$ sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/

Installing lxml in Python (Debian based).

If you're getting the "fatal ...

A Simple Django Project Layout

Monday, 12 March 2012

UPDATE: This article was originally written when Django version was 1.4. Since this article was published I made changes based on the new features of Django. You can see some of them in this repository: https://github.com/jackboot7/django-project-template.

This is short entry on how I organize my Django projects, in a way that will be easy to deploy to a production server. This is not meant to be a full tutorial on Django, but just to document ...

Python Audio Tools

Wednesday, 15 February 2012

Some days ago, I started to work on a web application that requires to encode audio wave files (.wav) into three other formats, being: MP3, Flac and M4A. That encoding will run in its own Celery task.

One thing I knew for certain is that I wouldn't be running commands such as lame or flac directly.

Since the project is being written in Python, I though it would be nice to use a library to do all the encoding ...

(Local) Online Python Documentation

Friday, 15 October 2010

Today I learned about the 'pydoc' command from Python.

Simply introduce this command in your terminal:

$ pydoc -p 8000

Then you can go to http://locahost:8000. This way you can browse the documentation for all your installed Python modules in the same way you'd use the 'help' command from the Python CLI.

[1] http://docs.python.org/library/pydoc.html

[2] http://pydoc.org/