articles filed under django
Create/update function for CLSQL
posted on 05/09/08 at 2:51 p.m. |
|
Django has a very handy model method in its database library called get_or_create, which either creates a new record using the keyword arguments passed as field values or gets a record using the arguments passed. Here is a simple way to implement a similar function in lisp.
Threading in Django
posted on 03/07/08 at 10:46 a.m. |
|
Profitable use of threading in web development is rare, particularly when contending with Python's global interpreter lock. There are a few notable exceptions to this.
Psyco and Django
posted on 02/15/08 at 4:25 p.m. |
|
Psyco is a module that optimizes Python applications on the fly. Numerous resources online describe how to use psyco in a Django-powered application to speed it up.
Per-user caching in Django
posted on 02/12/08 at 3:22 p.m. |
|
Django comes with an easy-to-use caching framework. With a few simple decorators, an application's views are cached. Decorators can even be used to control upstream caches, such as those maintained by ISPs. Nevertheless, if a rendered view is customized with information individual to a user, these caching options cease to be useful. Django has several solutions for this scenario.
Dynamic URLs in Django
posted on 11/12/07 at 3:40 p.m. |
|
I long ago switched my company's web applications from Code Igniter to Django. The main reasons were Django's more powerful database API and Python's maintainability and scalability over PHP. The only feature of Code Igniter that I really miss in Django is the ability to add a page without first registering the url, formulating a regular expression to describe the parameters and variations of the view function, and then creating the view and template.
For a production website, this is a better method than Code Igniter's strategy of http://domain.com/class/method/arg/arg/.../, but CI's is much easier during development. My urls may change half a dozen (or more) times in the course of the project, especially if marketing or advertising is involved. Fortunately, there is an easy fix.