Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Building A Blog with Django #3
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 … -
Just for always and for ever be with me
Idén is, ahogy már tavaly is, noha ezúttal új köntösben, van szerencsém bemutatni az érdeklődő hallgatóságnak a webes technológiák egy éppen aktuális gyöngyszemét. A 2006-os Magyarországi Web Konferencián Django: Python on Rails címmel fogok előadást tartani. 17-én, szombaton 22.00-kor a Love Alliance Soundsystem lép fel a Sarkban. Február 23-án pedig a General Levy szórakoztatja a [...] -
Ask Google: Python Web Framework Statistics
search-term web groups blog amazon.com-search python zope 8,920,000 20,700 2,294 9 python plone 2,730,000 2,420 784 2 python twisted 2,010,000 14,500 1,396 4 python subway 714,000* 2,380* 626 4 python aquarium 659,000* 4,340* 505 7 python django 543,000 2,660 [...] -
Looking at stats: Google Video
Let's take a look at Snakes & Rubies stats published on Google Video. But before that take a look at previous stats published on 1/27/2006. New stats include 5 more days covering 18 days of January 2006. Title Page views Downloads Snakes and Rubies (Adrian's Django presentation) 190 7 Snakes and Rubies (David's Rails presentation) 169 19 Snakes and Rubies (Q&A session) 89 2 Snakes and Rubies (full) 149 12 Totals 597 40 Lessons: More people read Django Community RSS feed than the news group, which was used for previous announcement. Duh. People followed my advice and went to watch Q&A Session. Very good! I know you were not disappointed. More people decided to watch Adrian's presentation this time than before. It boosted greatly his number of page views comparing to other video fragments. In fact it is the most watched fragment of the series. Adrian, next time I suggest you to start you presentation with your rendition of Super Mario 2 theme. People totally dig it! People watched the whole 3 hour movie instead of equivalent bits and pieces. It is amazing but true. At 30 viewers/day it will overtake individual fragments pretty soon, if not today. People favor … -
Building a Blog with Django #2
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. In the previous installment, I covered my database model for this weblog and explained how to get the basic database layout working with the nice Django administration panel. In this posting I will show you how to actually display your blog posts to your website visitors. I'll assume you already have a webserver working, with Django installed, and I assume you've already added a few blog posts using the admin tool discovered in part 1. The first step is telling Django what our URL structure will be. Django does this in a very cool way - it lets us use regular expressions to define what URL paths will be used on our website, and what Python code will be called by users requesting those addresses. To keep this clean I will move all of the blog URL configuration into it's own file. Let's tell Django to use this … -
Building a Blog with Django #2
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 … -
Python web frameworks
Now after two posts about Guido's quest for the Right Web Framework (1st, 2nd) I am starting to feel like his relay station. But I want to share his comment made in Matt's blog post on Python web framework shootout: Why criticize Django for claiming to be the best? Nobody has denied it, and yet it's criticized as if it were somehow unethical. Frankly, the problem is that there are too many Python web frameworks and wannabees, and if we don't start some kind of shootout, however subjective, we'll never get to market dominance of a few good ones. I'm not saying Django is already the winner -- but we are looking for a winner (or, more likely, a small set of winners) so future developers looking for a Pythonic solution only have to compare a small number of options, all mature, feature-rich, well-supported etc., rather than having to sift through 80+ half-baked solutions. I think it sums up nicely the current state of affairs, and explains why Ruby on Rails is more popular than any of Python web frameworks.. -
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 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 … -
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 … -
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 … -
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 more detail up soon. -
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 … -
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 … -
Dojo gets a manual
Since my last post hit the Dojo folks pretty hard for the lack of documenation, I’d be remiss if I didn’t point out that they now have a manual online. It’s far from complete at this point, but it covers most of the basics and it’s been really enjoyable to read through. I’d certainly say that huzzahs are in order. -
Django, meet Dojo
After hearing some rave reviews of Dojo on django-dev, I finally got around to checking it out today. Here are my thoughts (with an obvious focus towards) using Dojo with Django). The good Dojo is extremely powerful. With very little code I was able to make a really nice drag-and-drop reorderable table, complete with nice zebra striping and add/remove row buttons. (Wilson and I are working on a new kick-ass interface for Django’s “edit_inline” admin views, if anyone cares.