Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Atom feed supported
Scratch Blog now also supports Atom feed as specified in http://www.atomenabled.org/developers/syndication/atom-format-spec.php. This is also implemented using the Django Syndication Feeds Framework 1.2 and later. Some customizations have been used to let the framework generate the feed as per our requirement. -
Creating an Alphabetical Filter in Django's Admin
Update: See the new blog post about the updated version. Django’s admin includes a great date hierarchy filter for navigating date data in a model. I’ve come into a few situations where it would be nice to have a similar filter for the alphabet. If you are managing hundreds or hundreds of thousands of names, tags or other alphabetical data, it would be nice to filter things alphabetically. Using the date hierarchy as the template, I’ve implemented an alphabetical filter for the admin. The code and sample project is available on github and will soon be on PyPi. Implementing the Alphabet Filter There are three parts: The admin change_list.html template The alphabet filter template tag The alphabet.html template The change_list.html Template This template is easy to override on a per-model basis or per-application basis simply by where you save it. The current change_list.html template cannot be installed on a project wide basis as it extends admin/change_list.html and doing so leads to an infinite loop. Per Model: <application>/templates/admin/<application>/<model>/change_list.html or <project>/templates/admin/<application>/<model>/change_list.html Per Application: <application>/templates/admin/<application>/change_list.html or <project>/templates/admin/<application>/change_list.html Project Wide: Would have to copy contrib/admin/templates/admin/change_list.html to <project>/templates/admin/change_list.html and apply the appropriate changes. The template extends admin/change_list.html adding in some extra styling and overriding the date_hierarchy block. {% extends "admin/change_list.html" %} {% load admin_list alphafilter %} … -
Django Documentation for the iPhone
A better way of adding the Django documentation to your iPhone, iPod Touch or other mobile browser. -
Mayflower Barcamp - awesome!
Mayflower had invited me to join their Barcamp last weekend - and it was awesome. Thank you a lot!!! We had been a crowd of about 40 people all hacking all day long until deep at night, it was a great atmosphere and some very interesting projects had been made. ... -
Installing MySQLdb on Leopard
Thanks to Arne we got it done pretty quickly. -
Django’s dev server and UTF-8
From time to time I got this UnicodeEncodeError, but I had done all the things (sitecustomize.py, some more) right in order to configure the system in UTF-8. I thought. I did the usual ./manage runserver and since I assumed that on my Mac everything is already properly configured ... -
Customize admin for User model
Before django 1.0 I don't remember that there was a way to customize how the admin renders the User overview. Fortunately 1.0 does allow it. It took me a bit to figure out. After searching the web and the django docs I didn't find it right away, so I tried the ... -
dojo.beer(2)
We from uxebu have organized the second dojo.beer and are happy to have won Mayflower to jump in sponsoring the location here in Munich, Germany. On friday the 5th december we will warm up with some dinner and some beer in some place here in Munich. The real thing will ... -
The timeline for dojo meetup Berlin
The plan for May 31st, 2008 is 15:00 meet at Weltzeituhr, as mentioned on upcoming, more info and a pic see here. When you are on Alexanderplatz you should find this clock pretty quickly. 19:00 - 22:00 we will be in Las Olas and afterwards go to some bar, club, whatever we ... -
Django/Dojo Stammtisch in Berlin
For the second time Django enthusiasts are meeting in Berlin on Wednesday, the 15th April, 2009 at 19:30. Find all the details here. And since I will be in Berlin this time, I just simply redeclare this to "Django/Dojo Stammtisch" instead of just "Django Stammtisch" :-). I hope all the ... -
JavaScript: Sort object by a value
Actually the headline is not really what I want to say :-). But I don't know any better yet. I just want to write down how I solved sorting the following: >>> var maxSpeed = {car:300, bike:60, motorbike:200, airplane:1000, helicopter:400, rocket:8*60*60} This is a list of vehicles with their (approx.) ... -
dojo+django = dojango (just released)
Finally we have released dojango. Well, to be honest it's mostly Tobi's work that dojango rocks as it does! Big thanks! So if you are still looking for the right JavaScript toolkit to go with django then you are at the end of your search now. Use dojango! Dojango s a reusable ... -
Adobe Air Tour Europe stopped in Munich
Fortunately Tobias found out one day before that Adobe was touring with Air and coming to Munich. Adobe really had provided everything, from breakfast, drinks, lunch too I guess (we weren't there) and beer afterwards (that we didn't miss). It was really impressive. The talks were very Air focused, I ... -
Show a Custom 403 Forbidden Error Page in Django
Creating a custom 404 Page Not Found error page is so easy in Django (all you do is put your own template named “404.html” at the root of your templates directory) that I naturally assumed doing the same for a 403 Forbidden error page would be just as easy. Unfortunately it is not. After searching [...] -
MapOSMatic
MapOSMatic. Clever service built on top of OpenStreetMap, which renders double sided city maps with a map and grid on one size and an A-Z street name index on the other. Runs on top of Mapnik, PostGIS and Cairo, with a few thousand additional lines of Python and Django. -
Sorteamos "La guía definitiva de Django"
Hace días avisamos de que íbamos a sortear una de las copias de "La guía definitiva de Django" que Anaya Multimedia nos envió. ¡Y hoy nos ponemos a ello! Para entrar en el sorteo sólo tenéis que escribir un comentario en esta entrada mediante el formulario que encontraréis al final de la página explicando sobre qué os gustaría que escribiéramos en el blog de Django.es. Obviamente debe tratarse de algún tema relacionado con Django. -
I want to talk to Jython and Iron Python developers
I want to ask some questions of the Jython and Iron Python communities. I'm primarily looking for efforts that can go into publishable case studies. Experience in use of Django in the Jython and Iron Python environments is also very much desired. Please use my email address which is obfuscated below and can be decoded by simply running the code in a python shell:''.join([chr(x) for x in [112, 121, 100, 97, 110, 110, 121, 64, 103, 109, 97, 105, 108, 46, 99, 111, 109]]) -
Probando los sabores de localflavor
Django incluye la aplicación django.contrib.localflavor que agrupa campos de formulario y widgets específicos para distintos países. Vamos a ver lo que podemos hacer con el "local flavor" para España. -
Hosting Django static images with Amazon Cloudfront (CDN) using django-static
About a month ago I add a new feature to django-static that makes it possible to define a function that all files of django-static goes through. First of all a quick recap. django-static is a Django plugin that you use from your templates to reference static media. django-static takes care of giving the file the optimum name for static serving and if applicable compresses the file by trimming all whitespace and what not. For more info, see The awesomest way possible to serve your static stuff in Django with Nginx The new, popular, kid on the block for CDN (Content Delivery Network) is Amazon Cloudfront. It's a service sitting on top of the already proven Amazon S3 service which is a cloud file storage solution. What a CDN does is that it registers a domain for your resources such that with some DNS tricks, users of this resource URL download it from the geographically nearest server. So if you live in Sweden you might download myholiday.jpg from a server in Frankfurk and if you live in North Carolina, USA you might download the very same picture from Virgina, USA. That assures the that the distance to the resource is minimized. … -
Hosting Django static images with Amazon Cloudfront (CDN) using django-static
About a month ago I add a new feature to django-static that makes it possible to define a function that all files of django-static goes through. First of all a quick recap. django-static is a Django plugin that you use from your templates to reference static media. django-static takes care of giving the file the optimum name for static serving and if applicable compresses the file by trimming all whitespace and what not. For more info, see The awesomest way possible to serve your static stuff in Django with Nginx The new, popular, kid on the block for CDN (Content Delivery Network) is Amazon Cloudfront. It's a service sitting on top of the already proven Amazon S3 service which is a cloud file storage solution. What a CDN does is that it registers a domain for your resources such that with some DNS tricks, users of this resource URL download it from the geographically nearest server. So if you live in Sweden you might download myholiday.jpg from a server in Frankfurk and if you live in North Carolina, USA you might download the very same picture from Virgina, USA. That assures the that the distance to the resource is minimized. … -
Feature Switches at Disqus
Wrote up a post on how we use feature switches at Disqus within Django templates and views. (In the future we'll be posting all of our tech over on the Dev section of the Disqus blog) -
Hosting Django static images with Amazon Cloudfront (CDN) using django-static
About a month ago I add a new feature to django-static that makes it possible to define a function that all files of django-static goes through. First of all a quick recap. django-static is a Django plugin that you use from your templates to reference static media. django-static takes care of giving the file the optimum name for static serving and if applicable compresses the file by trimming all whitespace and what not. For more info, see The awesomest way possible to serve your static stuff in Django with Nginx The new, popular, kid on the block for CDN (Content Delivery Network) is Amazon Cloudfront. It's a service sitting on top of the already proven Amazon S3 service which is a cloud file storage solution. What a CDN does is that it registers a domain for your resources such that with some DNS tricks, users of this resource URL download it from the geographically nearest server. So if you live in Sweden you might download myholiday.jpg from a server in Frankfurk and if you live in North Carolina, USA you might download the very same picture from Virgina, USA. That assures the that the distance to the resource is minimized. … -
Hosting Django static images with Amazon Cloudfront (CDN) using django-static
About a month ago I add a new feature to django-static that makes it possible to define a function that all files of django-static goes through. First of all a quick recap. django-static is a Django plugin that you use from your templates to reference static media. django-static takes care of giving the file the optimum name for static serving and if applicable compresses the file by trimming all whitespace and what not. For more info, see The awesomest way possible to serve your static stuff in Django with Nginx The new, popular, kid on the block for CDN (Content Delivery Network) is Amazon Cloudfront. It's a service sitting on top of the already proven Amazon S3 service which is a cloud file storage solution. What a CDN does is that it registers a domain for your resources such that with some DNS tricks, users of this resource URL download it from the geographically nearest server. So if you live in Sweden you might download myholiday.jpg from a server in Frankfurk and if you live in North Carolina, USA you might download the very same picture from Virgina, USA. That assures the that the distance to the resource is minimized. … -
Formularios con Django sin SPAM
¿Quieres luchar contra el SPAM en tus formularios sin tener que modificarlos? Una forma sencilla de evitar gran parte del SPAM automático son los snippets AntiSpamForm y AntiSpamModelForm. Están basados en los formularios anti-spam que utiliza la aplicación django.contrib.comments... -
Class based views in Django
Abstract Never been frustrated doing functional programming in your django views ? This little module is intended to help you use objects for your views : Replace urls parameters and template context by class attributes. Use inheritance to group common task, do specializations, common decorators... Define template tags in your objects, call instance methods. Define your re-usable library. This code is now quite complete and we use it in production environment. Hello World comparison Consider this example (classic way): urls.py from django.conf.urls.defaults import * from views import hello urlpatterns = patterns( '', (r'^hello/(?P<times>\d+)/$', hello), ) views.py from django.shortcuts import render_to_response from django.template import RequestContext def hello(request, times=10): name = request.user and request.user.username or 'Pony' times = range(int(times)) return render_to_response('hello.html', { 'times' : times, 'name' : name }, context_instance=RequestContext(request)) hello.html {% for i in times %} Hello {{ name }} {% endfor %} Now with ViewsObject: urls.py from django.conf.urls.defaults import * from django_pimentech.viewsobjects import ObjectCaller from views import Hello urlpatterns = patterns( '', (r'^hello/(?P<times>\d+)/$', ObjectCaller(Hello)), ) views.py from django_pimentech.viewsobjects import BaseView class Hello(BaseView): template = 'hello.html' name = None times = 10 def fill_context(self): self.times = range(int(self.times)) self.name = self.request.user and self.request.user.username or 'Pony' Besides the object syntax, the main idea …