Entries Tagged ‘Python’:

Django RequestContext Example

Browsing other peoples’ code is a great way to learn new things about a language or framework. I never made it to the Django docs about Contexts, but the
Pinax developers apparently did and I got a chance to learn this from them. This is a few sections of their code and how they use [...]

Setting up Apache2, mod_python, MySQL, and Django on Debian Lenny or Ubuntu Hardy Heron

Both Debian and Ubuntu make it really simple to get a server up and running. I was trying a few different Machine Images on Amazon and I found myself repeating a lot of things so I wanted to put them here for reference for those who might find it useful.
With a fresh image, the first [...]

Static Files in Django on Production and Development

Update 2009-03-25
I realize why this isn’t needed. If your production environment is set up correctly, django will never serve the static urls and you aren’t running the django development server anyways, so having django.views.static.serve in your urls file won’t hurt anything. But it is nice to have if multiple people will be developing this on [...]

Quick Thumbnails in Django

I normally like to write code myself instead of installing some large script just to do one task for me. There were a few scripts out there that could create thumbnails, but I wanted something simple and wouldn’t use most of those features. Plus, I wanted to know how to use the Python Image Library [...]

Programming Analogies

I like to think of programming languages as tools. It’s always best to use the right tool for the job… but sometimes there isn’t a choice.
Say you have 4 hammers in the toolbox, a JSP hammer, a php hammer, a Ruby hammer, and a Python hammer. The Ruby and Python hammers are nice looking [...]