Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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 … -
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( … -
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. -
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. -
Have more…
Have more than thou showest, Speak less than thou knowest, Lend less than thou owest, Ride more than thou goest. — King Lear 1.4.71-4 -
Django performance tips
Django handles lots of traffic with ease; Django sites have survived slashdottings, farkings, and more. Here are some notes on how we tweak our servers to get that type of high performance. Use a separate media server Django deliberately doesn’t serve media for you, and it’s designed that way to save you from yourself. If you try to serve media from the same Apache instance that’s serving Django, you’re going to absolutely kill performance. -
Snakes, rubies, and some comments
A week ago I posted a link to David's take on "Snakes and Rubies" event. Of course I am talking about article written by RoR's creator. It is a great read, but this time I've read reader's comments (or "challenges to the Loud Thinking"). Oh, boy! It gives you insight into Rails, Django, and their perception by developers and users. For example, I am not very familiar with i18n problem, but it looks like a lot of people were quite passionate about it. In general it gave me a different prospective on problems of fellow DreamHost customer Alex Payne (outlined here). When I was setting up some of my stuff on DreamHost using Django I had to figure out some things: proper FastCGI setup, .htaccess incantations, and so on. I was kind of envious of RoR's users because "Ruby on Rails now fully supported complete with FastCGI!" (taken from What's New marquee section of DreamHost's main page). I assumed DreamHost had these problems solved. It did. I didn't know at that time that there are some other problems mentioned by Alex. Django is rock solid, I never had problems with stability, memory leaks, and so on. My blog is up … -
Django Ajax Redux
Three weeks ago we had a discussion about Ajax support in Django, which resulted in "Ajax and Django" wiki page. A short recap: it lists a vague goal, some general considerations, and possible strategies; it scratches the surface of existing implementations (mostly RoR), existing third-party toolkits (Mochikit/Dojo), and related RPC-style and REST-style services. No code was produced, no consensus was reached, but now it is a part of Django's Version One roadmap. Now three weeks later I assume that everybody had time to think about it. I want to move the whole discussion on to a more practical plane. Basically I want to propose an implementation. At least I’ll collect your thoughts, criticism, corrections, and, hopefully, blessings. Giving the speculative nature of this proposal, which is based solely on my experience, I decided against posting it in the wiki in its present form. The size of this proposal is not conductive to mail list posting. Hence it is here. Saddle up. Rationale I am a conservative pragmatic, who values the art of possible — don’t expect any outrages proposals. And like many programmers I am quite lazy — don’t expect glorious efforts required to implement my proposal. What I want … -
Hiring, part II
Want to work for the most innovative news organization in the country, if not the world? Want to join a team of the best and brightest online media developers? Want to get paid to create award-winning web sites? Well, have I got the job for you: World Online is looking for a kick-ass front-end web developer. Update This position has been filled; thanks to everyone who applied. We’re still hiring a back-end web programmer, though. -
We're hiring!
Want to work for the most innovative news organization in the country, if not the world? Want to join a team of the best and brightest online media developers? Want to get paid to create award-winning web sites? Well, have I got the job for you: World Online is looking for a kick-ass web developer to join our team. About the job Unofficially, the job description is “build cool shit.” Our goals are nothing short of being the coolest and most innovative web team in the world. -
Lightpd on Ubuntu
Ubuntu “Breezy” doesn’t have lighttpd (yet), and the only Ubuntu binaries I could find were (a) stale and (b) compiled for x86. Building lighty from source with the standard configure; make; make install dance works fine, but it forgoes APT… and why would you use Ubuntu if you wanted to avoid APT? So, here’s how to build lighty from source into a Ubuntu package so it’s all nicely wrapped up and maintained for you. -
Simpler Apache FCGI Django
Inspired by some tips I saw someplace else, and some fiddling on my own, a simpler Django setup on Apache/mod_fcgi: ... -
Simpler Apache FCGI Django
Inspired by some tips I saw someplace else, and some fiddling on my own, a simpler Django setup on Apache/mod_fcgi: ... -
Django alternate auth HOWTO
One of the most frequently-asked questions about Django is "How do I change the authentication system to (hook into my ... -
Django alternate auth HOWTO
One of the most frequently-asked questions about Django is "How do I change the authentication system to (hook into my ... -
What can Django learn from Rails?
One of the questions asked at Snakes & Rubies was about what Django could learn from Rails (and vice versa). Once I finish wrestling Final Cut Pro to the ground you’ll be able to see how Adrian and David answered the question, but in the meantime it got me thinking about some cool features of Rails that are worth ripping off… er… being inspired by: find_or_create convenience methods. -
EN, CZ | No tutorials in czech | české tutoriály smazané
EN (CZ je dole):Improved new admininistration tool of Django has been merged into the main development trunk. That's very nice. SVN Update did not work and unfortunately I deleted accidentaly the czech translation of the tutorial :( CZ:V hlavní vývojové větvy Djanga se objevila nová, přepracovaná forma administračního rozhraní. To je skvělá zpráva. Hlavně tím, že se podle to rozhraní dá znovu použít třeba pro vlastní pohledy.Co je ale špatné, že kvůli tomu jsem omylem smazal překlady úvodního tutorialu. A ať jsem zkoušel nějaké undelete recovery programy, tak nikde nic :(Ach jo. -
EN, CZ | Python Testing Tools
EN: (CZ je dole)Grig have just posted on his blog the list of testing frameworks for Python and Web apps.Even though Django utilizes doctests for its core features, it is definitely testing tool for your models only (and might be for some business logic).Yes, you can mention that Djangotesting (made by the great Hugo) is put into the list of web testing tools, however just note this sentence: "but for now only the model tests are done".Therefore I definitely suggest using other tools mentioned on the list.CZ:Grig právě publikoval na svém blogu seznam testovacích frameworků pro Python a webové aplikace.Ačkoli Django využívá doctests pro svojí interní funkcionalitu, přičemž to samé mohou použít ostatní vývojáři používající Django, myslím si, že doctests je nástroj pouze pro testování modelů (a možná nějaké business logiky).Samozřejmě můžete namítnout, že na seznamu web testovacích nástrojů je také Djangotesting (udělané Hugem zodpovědným za podporu vícejazyčnosti Djanga), ale pokud se podíváte na stránky Djangotesting, tak dole je uvedená věta: "ale teď jsou udělané testy pouze pro modely".Proto rozhodně doporučuji použít i jakýkoli jiný nástroj uvedený na seznamu od Griga.