Archive for the 'django' Category

Generating Javascript Widgets with reversed URL endpoints in Django

I just read Elf Stenberg’s solution on how to serve static Javascript with reversed URLs in Django, I was going to leave this as a comment but I better explain it here
When developing Django Widgets that require Javascript interaction with the server (Ajax, XHR, etc… ), you want your widget seamlessly deployable and [...]

Read More..>>

Django 1.0 Template Development

Last month I got an email from Packt telling me about their latest book on Django Template development. I was invited to give it a read and see how I liked it.
Now, I’m a lazy and slow reader. But this book was quite an easy read. I liked how fast I went through the pages [...]

Read More..>>

So it has a snake inside doing all the magic!

Great drawing used by the Nebula team at Nasa to show proudly that they use Django for their development.

Read More..>>

Using object_list generic view for pagination in Django

Whenever I want to display a list of items I’ll need pagination, calculate first page, next page, total pages, current page, previous page, etc.
Although Django comes with pretty good pagination helpers, I’ve found that using the list_detail.object_list generic view hanles this very nicely
So whenever I want to display a list, I will return [...]

Read More..>>

Access MEDIA_URL from static Javascript files in Django

This is an old trick, that’s been very handy .
Many times for various reasons you’ll need to access your media files from your Javascript files, to display images, change paths, or whatever. And in most cases your development MEDIA_URL and production MEDIA_URL will be different, so having to change them depending on the enviroment [...]

Read More..>>

Django cheap pages

Sometimes I end up using Django for the wrong thing, just to dispatch pages and put all my content in the templates. Flatpages are too flat and other DB based content tools are too complex. I just want to use the dispatcher, and the templates (I know, I could use web.py, or whatever other Python [...]

Read More..>>

Happy Django-ween

The folks here at Aureal did a great job carving the Django pumpkin .

Read More..>>

Mi charla de Introducción a Django

El fin de semana pasado tuve la oportunidad de dar nuevamente una charla de Django en el evento OpenSource Day de la Universidad San Martín de Porres.

Aquí están mis diapositivas de Introducción a Django, y aquí el código de ejemplo usado.
Los archivos son válidos para Django 1.0.

Read More..>>