Technical Recipes

Wednesday 8, February 2012

You can find a classifiers list for your setup.py file. This is very useful for building your own Python packages.


Wednesday 8, June 2011

South is a very good tool for handling migration with Python and Django.

For applying a new migration after changing some things in our models we need to execute the following commands:

 $ ./manage.py schemamigration myapp --auto
 $ ./manage.py migrate

Wednesday 8, June 2011

We assume you've installed virtualenv:

 $ virtualenv --no-site-packages /tmp/test
 $ cd /tmp/test
 $ source bin/activate

If you need to install virtualenv:

 $ sudo pip install virtualenv

If you prefer more flexibility for handling different virutalenvs, you can use virtualenvwrapper:

 $ sudo pip install virtualenvwrapper

Creating a new directory for storing virtualenv files:

 $ mkdir $HOME/.virtualenvs

Edit your .bashrc and add the following lines:

 export WORKON_HOME=$HOME/.virtualenvs
 source /usr/bin/virtualenvwrapper.sh

Creating a new environment:

 $ mkvirtualenv --no-site-packages temp

Working with this new environment:

 $ workon temp

Listing all virtual environments:

 $ workon
tags: python

Thursday 26, May 2011

You only need to execute the following Python code:

''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789! \
 @#$%^&*(-_=+)') for i in range(50)])

Tags

My latest tweets

tweet Only one week for Fedora 17! #fedora
tweet At Least 100,000 March in Spain Over Austerity http://t.co/LIvRCkTO
tweet Hoy es el día: Protesta como un ciudadano o calla como un súbdito. Tú eliges #12m15m
tweet Somos campeones!! #atleti
tweet Dell is working on a new laptop designed for developers with Ubuntu http://t.co/CemtM2fw
tweet Good tutorial about Flask, how to get up and running a web application with Python http://t.co/RtcW4f9d
Buy me a coffee!! Coffee cup

Advertisment