Monthly Archives: March 2012

Setup Logger in Django 1.3 to show warning & error in console development

New guys in Django commonly have a headache to see Logger configuration in settings.py. Sometimes people only want use Logger to print error / warning / debug in server development. Here are how to do that. First, open up your … Continue reading

Posted in Django | Tagged , | Leave a comment

Example how to rsync and restart services remote server using Fabric

Fabric is great tools in Python which can ease our development. You can start installing it by : 1sudo pip install fabric Let create some example cases here. 1. I have remote server which have port SSH (it a must!) … Continue reading

Posted in Django | Tagged , | Leave a comment

create simple example JSON REST API in Django 1.3

Creating REST JSON API in Django in pretty easy. I know several django modules like django-tastypie, django piston, etc provide easy ways to build REST API in Django, but at this time, I will show simple example. First, we should … Continue reading

Posted in Django | Tagged , | 2 Comments

Python Requests Module get Json content into dictionaries

Requests Module is great python module to use urllib2 in easy ways. For instance, let we get some JSON from my Gravatar : 1https://es.gravatar.com/bashlook.json In case you need how to get JSON value using urllib2 : 1234567891011import urllib2 import json … Continue reading

Posted in Python module | Tagged , | Leave a comment

Delete FileField using delete(save=False) in signals post_delete Django

We can’t overwrite delete() for deleting FileField and related files in Django. As we know that : In Django 1.3, when a model is deleted the FileField’s delete() method won’t be called. If you need cleanup of orphaned files, you’ll … Continue reading

Posted in Django | Tagged , | Leave a comment