Articles tagged with django:

page 1 of 2 next page >>

Django sitemap class for named views

29 October 2008 django, seo

This sitemap class allows you to specify which named views your sitemap should include. Useful for views that don't map to models, or when you don't want to include all your flatpage or "direct-to-template URLs.

read full entry...

Django WSGI handler and SSL proxies

23 October 2008 django, proxy, ssl, wsgi

When serving both HTTP and HTTPS in my preferred deployment setup — nginx in front of Apache with mod_wsgi running Django — I had to figure out how to let Django know whether a request was secure or not. Here's how I did it.

read full entry...

AJAX upload progress bars with jQuery, Django and nginx

21 October 2008 ajax, django, jquery

I've included upload progress bars on a couple of Django sites. Thanks to the new file handling in Django 1.0 and a couple of code snippets from djangosnippets.org, it's really not difficult, but I haven't seen a complete example, so I put together a demo app showing how the pieces fit together. I'll also cover the case where you want a proxy to provide the upload progress tracking, without involving Django.

read full entry...

Immutable Django model fields

22 June 2008 django

I wanted to make a field on a Django model read-only after it was assigned an initial value. Maybe I was having a slow day, or my Google-fu was especially lacking, but I couldn't find a documented way to do this. There's the editable Field option, but I wanted to ensure I couldn't mistakenly overwrite the initial value anywhere — not just in the admin interface or form processing. It turned out to be pretty easy.

read full entry...

Django geography hacks

16 April 2008 django, geography, location

If you need to handle some basic geography in your Django application, but can't or don't want to use GeoDjango, here are some quick hacks to accomplish simple geocoding and distance calculations.

read full entry...