Archive | Django RSS feed for this section

Singleton and Unit Tests

9 Oct

Singletons [1] are considered a cancer for many people, however, while python modules can act very well as singletons they can’t be extended, and then we use a singleton class. I have using singletons classes in two projects, first is django-breadcrumbs, that use singletons to store breadcrumbs and than present it in templates. Another project, […]

Solving (partially) South issue on not updating permissions.

9 Mar

South have a already know issue [1] about no update permissions of added models. The common fix is run manage.py syncdb –all, Django Extensions [2] app also have a management command called update_permissions what is very usefull and also do the job. But, any of us want to remember about that every time, so to […]

JSONResponse – Trabalhando com JSON em Django, o jeito fácil.

14 Apr

There are dozen of articles and snippets about how work with JSON and Django, however I saw that most are a bit vague and solution involves use of simplejson to serialize and HttpResponse to send response from the view. There are some details that normally aren’t covered and now I show a easy way and […]

Vim confs prontas para trabalhar com Python e Django

7 Mar

This weekend I reworked on my .vimrc and put some extra time in make things work better for me in python and django coding :). I did a nice job and now I can code with much more goodies. Results are: A very commented and customized .vimrc. Support for python omnicompletion. Adding django and python […]

Configurando múltiplos ambientes Python

27 Jan

Multiple python environments Work with various python versions with multiple versions of python environments has become something common in my life, and, I believe that an easy way of setting this environments are something very useful, and not simple for most of people. I created a simple shell script that set this environment, that is […]

Manipulando erros Http 403 (permissão negada) no Django

24 Nov

In this post, I show a new Middleware, built to deal with errors 403 (Http Forbidden, access denied) like we work with 404 error in Django.

Pensamento rápido – “ilike” SQL

4 Sep

Today I saw a post at one of the blogs I often watch, where a guy said he got 1000% of speed boost in a aplication by changing: uma aplicação trocando um: SELECT * FROM table WHERE fieldname ILIKE ‘abc%'; For SELECT * FROM table WHERE lower(fieldname) LIKE ‘abc%'; (changed ilike to lower … like) […]

Django apps (coleção) – parte 1

19 Jul

Actually, I’m working with Python e Django, both language and framework are excellency softwares and I’m have plans to develop a big project with Django. So, as my first post about Django on blog I’m listening here a bunch of useful apps for your project. Most of this apps was found in a fast search […]