Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Template + Cache = Crazy Delicious
Here’s a simple class for a template tag that caches its output (with apologies to Chris Parnell and Andy Samberg): from django.core import template from django.core.cache import cache from django.conf.settings import DEBUG class CachedNode(template.Node): """ Cached template node. Subclasses should define the methods get_cache_key() and get_content() instead of the standard render() method. Subclasses may also define the class attribute cache_timeout to override the default cache timeout of ten minutes. """ cache_timeout = 600 def render(self, context): if DEBUG: return self. -
Guido reports: Django vs. Cheetah 1-0
Finally Guido got some time to play with goods. The verdict is in: Django vs. Cheeta 1-0.. -
Guido reports: Django vs. Cheetah 1-0
Finally Guido got some time to play with goods. The verdict is in: Django vs. Cheeta 1-0 . -
Guido on web frameworks, again
If you liked reading Guido's previous post on Python web frameworks (Rails was mentioned too) and discussion that followed, you should read his second installment: Web Framework Redux. Don't forget to voice your opinion in the forum.. -
Guido on web frameworks, again
If you liked reading Guido ’s previous post on Python web frameworks (Rails was mentioned too) and discussion that followed, you should read his second installment: Web Framework Redux . Don’t forget to voice your opinion in the forum . -
Django Dojo
Django-Dojo alliance was finally announced to the world by our very own Jacob Kaplan-Moss: Starting with version 0.92 (which should be out in a few weeks, Murphy willing), Django is going to bundle Dojo with the toolkit. Specifically as part of Django's admin interface (but available to user apps as well). Read all about it in Jacob's post. I am overjoyed to see such cool high quality open source projects are working together. Clearly it will make it easy to create kick-ass highly interactive web applications in Django and it will advance Dojo positions as a premier AJAX toolkit. It is a rare win-win situation for everybody involved including users of both frameworks. Some people, who fault Django on building its own components instead of reusing existing ones, will be surprised by this decision. Let me clarify that Django community is not affected by DIY and NIH syndromes. Being a part of it I can say that a lot of options are debated, and the most compelling alternative is used. This is the secret sauce, which makes Django so solid and consistent. Selection of Dojo is just a visible evidence of this approach. A lot of people are using Dojo … -
mobile.kusports.com
Over the past few days I’ve been spending some free time and downtime tweaking mobile.kusports.com and adding a couple of really cool (IMHO) features. We send out a ton of cel phone updates during each game, but I really wanted to bring our awesome live stats to mobile devices. The first order of business was to see how the low-tech live stats view looked on the mobile site. Since pretty much all of our templates extend a base template, it looked pretty darn good out of the box (thanks to template inheritance and some great default templates by Wilson and David). Most of the time spent on this template was to condense the stats a little bit to require less scrolling on small devices. Here is the live stats view using Opera Mini on my 6682: Having the live stats accessable from mobile devices is great, but it’s important to make it extremely easy for someone to get to them if they come to mobile.kusports.com while a game is in progress. The solution was to present the current score on the home page if and only if a game is in progress. This was accomplished by writing a custom template … -
Django Dojo
Django -Dojo alliance was finally announced to the world by our very own Jacob Kaplan-Moss : Starting with version 0.92 (which should be out in a few weeks, Murphy willing), Django is going to bundle Dojo with the toolkit. Specifically as part of Django’s admin interface (but available to user apps as well). Read all about it in Jacob’s post . I am overjoyed to see such cool high quality open source projects are working together. Clearly it will make it easy to create kick-ass highly interactive web applications in Django and it will advance Dojo positions as a premier AJAX toolkit. It is a rare win-win situation for everybody involved including users of both frameworks. -
Full Snakes & Rubies video is live
Finally full Snakes & Rubies video went live on Google Video! And it took only 18 days to verify it (19 days, if you count when I started to upload it). Apparently the whole process of verification depends on file size nonlinearly. It cannot depend on content because it is a combination of smaller files: Adrian's Django presentation, David's Rails presentation, and Q&A session. Oh, well. And now is time for some stats (1/9/2006–1/27/2006): Title Page views Downloads Snakes and Rubies (Adrian's Django presentation) 83 1 Snakes and Rubies (David's Rails presentation) 96 11 Snakes and Rubies (Q&A session) 36 1 Snakes and Rubies (full) 0 0 Totals 215 13 As you can see publishing files on Google Video was worth it. It helped ~200 people. Obviously nobody was able to see the full video yet because it just went live. One interesting tidbit: viewers loved to download David's presentation. Downloading Google Video file (.gvp) gives you a small text file, which references the web site and nothing more. You can save URL with the same effect. Of course some smart alecks can use tools to download actual video (.flv), but why? Much better original is available without restrictions and … -
Full Snakes & Rubies video is live
Finally full Snakes & Rubies video went live on Google Video! And it took only 18 days to verify it (19 days, if you count when I started to upload it). Apparently the whole process of verification depends on file size nonlinearly. It cannot depend on content because it is a combination of smaller files: Adrian’s Django presentation , David’s Rails presentation , and Q&A session . Oh, well. And now is time for some stats (1/9/2006–1/27/2006): -
OpenWrt QoS
It looks like nbd was able to find the problem, which plagued many people (including me) with QoS. You can find details in this thread on OpenWrt forum. Instructions on how to install QoS package can be found in this FAQ entry . Give it a whirl and don’t forget to thank Felix Fietkau (nbd ). QoS was the biggest feature on my "wanted" list. It means now I can produce an OpenWrt GUI (webui) module to deal with it. It coincides well with release of Dojo 0.2.2 . But most probably I’ll be using a snapshot because guys added so much new stuff to Dojo preparing for Dojo 0.3 (widget release). Given the stability of OpenWrt GUI Homunculus Alpha release , I may upgrade new release to Beta status. -
Why you should use Django
Inspired by Guido van Rossum’s plea to be taught web frameworks here are (in no particular order) ten reasons why he — and you — should use Django. 1. Django works — right now Don’t be fooled by the fact that Django’s first release was in July. It’s been under heavy use for over two years, and I’m confident saying it has no show-stopping bugs. I’m tired of hearing that that SomeAwesomeFramework™ will be “great when it’s finished”. -
Building a Blog with Django
NOTE The Python code in this tutorial no longer works with Django! Please read my new article, a Django Blog Redux, for code that works on newer versions of Django. The rest of this article, such as the theory, is still very much applicable and should be read alongside my newer code. When I first posted about Django, I said that I'd post the details of how I wrote a blog in Django, without actually writing any real Python code. This will show you how you too can have a simple blog working in no time at all. I'll assume for this article that you've got Django installed and working, and you know the basics. Create a new project and within it create a 'blog' application. Edit the models file for that application, so it contains the following text: from django.core import meta class Tag(meta.Model): slug = meta.SlugField( 'Slug', prepopulate_from=("title",), help_text='Automatically built from the title.', primary_key='True' ) title = meta.CharField('Title', maxlength=30) description = meta.TextField( 'Description', help_text='Short summary of this tag' ) def __repr__(self): return self.title def get_absolute_url(self): return "/tag/%s/" % self.slug class META: admin = meta.Admin( list_display = ('slug', 'title',), search_fields = ('title', 'description',), ) class Post(meta.Model): slug = meta.SlugField( … -
Building a Blog with Django
NOTE The Python code in this tutorial no longer works with Django! Please read my new article, a Django Blog Redux, for code that works on newer versions of Django. The rest of this article, such as the theory, is still very much applicable and should be read alongside my … -
My experience with Google Video
Some time ago Jacob Kaplan-Moss released his documentary about Snakes & Rubies event . It is a must see video for all serious programmers working in different fields because it gives you a rare chance to understand the motives of two successful software projects. Pretty soon it became obvious that sending links to hefty files or torrents is not the best way to spread the word — people are lazy and distractible. I needed something, which can play almost immediately. What can be better than Google Video (Beta) ? Jacob gave me his blessing and I started the process. -
Clients: thin vs. thick
Brad Neuberg wrote a good article , which compares two different approaches to AJAX: thick client (e.g., Dojo style) and thin client (e.g., Prototype style). While it does a good job contrasting two approaches, I want to underscore that the underlying problem is a clash of two cultures between "local application" developers, and "web site" developers. There is no doubt that local applications create the most satisfying end-user experience. Their typical weakness is in restriction of underlying data to local installation, which makes any collaboration impossible. "Connected applications" can help to alleviate this problem, but networking is hard in general and many local app programmers try to avoid it. They don’t have proper culture to do it, existing network APIs are hard to combine with GUI, and so on. In general they don’t get it. -
Strike averted
I’m thrilled to announce we’ve hired James Bennett (a.k.a ubernostrum in #django) as World Online’s new front end developer. About a month ago he wrote: I’m desperately looking for someone to pay me to build something with Django, and if it doesn’t happen soon I’m just going to go on strike. Whew — strike averted. Seriously, though we’re extremely excited to have James joining our team, and we can’t wait to see the cool shit he’s going to build here. -
Django - My First Impressions
Until last week I had never heard of Django, a web framework written in Python. I'd seen python before, but had never really tried it out - I could do everything I wanted to do in PHP, and having libraries such as Smarty available to me solved all my problems. Or so I thought. I thought I'd give Django a shot as I'd seen it touted as the Ruby on Rails killer in Python. I downloaded it, installed it on UGBox, enabled mod_python and walked myself through the Django tutorial. Not 15 minutes later I had a working application, but I'd written bugger all code. This inspired me. Django has a publishing background - it was originally written for use by a number of newspapers and websites in Lawrence, Kansas. I've been working on a website for a little while now (which is still not live - it'll be ready soon, and is aimed at Blokes in Australia) which follows a similar publishing model - articles, authors, categories, comments... pretty straightforward stuff. I got to work writing a simple data model in Django during my lunchbreak last Friday. In one file I set out some basic details for my database … -
Django - My First Impressions
Until last week I had never heard of Django, a web framework written in Python. I'd seen python before, but had never really tried it out - I could do everything I wanted to do in PHP, and having libraries such as Smarty available to me solved all my problems. Or … -
Getting Started With Django
I've just written this quick weblog app using Django - a new(ish) web framework written in Python. So far it seems pretty damn good - I've also written an article management system for a new website I'm starting, and it only took a lunchbreak to get going. Amazing. I'll post some … -
Getting Started With Django
I've just written this quick weblog app using Django - a new(ish) web framework written in Python. So far it seems pretty damn good - I've also written an article management system for a new website I'm starting, and it only took a lunchbreak to get going. Amazing. I'll post some more detail up soon. -
Where do old programmers go?
Nowadays this question is asked frequently. A lot of guys in their 30s realize that they are the oldest guys in their groups. 20+ guys don’t see wise sages around. What is going on? It was debated on /. without any productive outcome (as usual). Let’s take a look at the problem using available statistics. One nice source of data is the National Center for Educational Statistics . I made a chart using Table 280. "Earned degrees in computer and information sciences conferred by degree-granting institutions, by level of degree and sex of student: 1970-71 to 2002-03" (only totals are used): -
Done
Yes, the Snakes and Rubies videos are now online. No, they’re not perfect. No, I’m not going to wait for FCP to re-render any more. I’ll write a post-mortem after I’ve gotten some sleep; now go watch Adrian kick major ass. -
Live Filtering
Update on 11/25/2007: today this article presents mostly historical interest. Since Dojo 0.2 a lot of versions were published and many things were changed. At the time of this writing Dojo is at ripe 1.0. I had to disable all Ajax action in examples because I don't use Dojo 0.2 anymore. What is Filtering? It is a selection of items using some criteria (filter). In this tutorial I am going to filter documents of my blog (made with Django, of course) matching titles against user-specified substring. Later on I'll talk about generalization of this approach. Just like a big boy I am going to use Custom Manipulators, which can be avoided, but I want to show how to use it. We all want to improve end user's experience. To improve usability I'll put a little "live" in it using Ajax (courtesy of Dojo) later on. You can see for yourself how simple it is. Filtering Django's ORM provides several ways to do a substring search: contains, icontains, startswith, istartswith, endswith, iendswith. Which one should we use? Let's do all of them. I am going to create a separate function, which will take user's input as parameters and returns a string … -
Live Filtering
Update on 11/25/2007: today this article presents mostly historical interest. Since Dojo 0.2 a lot of versions were published and many things were changed. At the time of this writing Dojo is at ripe 1.0. I had to disable all Ajax action in examples because I don’t use Dojo 0.2 anymore. What is Filtering? It is a selection of items using some criteria (filter). In this tutorial I am going to filter documents of my blog (made with Django , of course) matching titles against user-specified substring. Later on I’ll talk about generalization of this approach.