Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django IRC logs to the rescue
The 2nd Django tutorial starts with getting the admin interface up and running by creating an initial user account and using the built in development web server. However, after following the instructions quite closely I was still getting Tried all URL patterns but didn't find a match for /admin when requesting the admin URL. A search of the IRC logs for #django revealed that for it to work the settings module must be set to .admin so if you're using myproject.settings.main for the working with the model in the first tutorial you'll need --settings=myproject.settings.admin. -
DreamHost: Python 2.4.1
DreamHost has installed Python 2.4.1. Somehow I didn’t see it before. Default python goes to Python 2.3.5. Use python2.4 instead. -
OpenWrt GUI: it works, kind of
I decided to post some screenshots of OpenWrt GUI running on my browser. I didn’t package it as .ipk yet. Screenshots are hosted on Flickr . If you want to see full-size picture (== undistorted by scaling), go to "different sizes" (it is in "Additional information" on the right side), and select "Large". Please bear in mind that this is the first cut without any niceties. I’ll put some niceties in, but I want to have working functionality first. -
OpenWrt: jumpstart with JTAG
As you know I bricked my wireless router. All simple things were tried without any positive effect. Kaloz (of OpenWrt fame) has advised me to try JTAG . It’s a very simple thing: you need a computer, a proper software, and JTAG cable, which can be self-made . Obviously the last part is the crucial one. I made a trip to my friendly neighborhood Altex store and bought all necessary parts: 4 100 Ohm resistors, male & female 14 pin IDC connectors (they didn’t have 12 pin ones, which were modified later using cutters), 25 pin male SUB-D, and 3’ 25 pin male to female cable — I figured I’ll make extremely short JTAG "cable" and attach it to short printer cable. The last item was the most expensive part: $3.99. It took me about 5 minutes to put everything together. -
Ian Maurer: unit testing
In his blog post Ian Maurer shares a very slick way to run unit tests with SQLite’s in-memory database. Check it out: http://itmaurer.com/blog/?p=2 Simple, elegant, practical. -
OpenWrt GUI: good, bad news
Today I have good news and bad news. The good news is tonight I was able to work on AJAX OpenWrt GUI a little bit more. It is coming together. I coded my first applet. It shows current stats, nothing fancy. The bad news is I bricked my router apparently by running nvram show repeatedly. I suspect that nvram is corrupted beyond salvation. I have to reset it somehow. I tried simple recipies listed in OpenWrt Wiki but no luck so far. I’ll try to revive it on weekend. I have a feeling that my future lies with JTAG. Until the router is up I cannot debug OpenWrt GUI. -
Running on InnoDB now
O.K. I migrated to InnoDB using backup/restore. So far so good. Don’t forget to replace all "MyISAM" to "InnoDB" in your backup files before restoring them to new databases. -
It finally happened!
Joy to the World! DreamHost just started to offer MySQL/InnoDB! Finally we can do transactions. Just three weeks ago they "didn’t have any plans." Wording of the news is kind of strange: "we now offer InnoDB support on all new MySQL databases anybody adds from our web panel." It turned out I cannot change my existing databases. Oh, well. I can copy them. -
Technorati Rank
Today I learned that this blog is ranked 775,745 by Technorati ! It means that only 775,744 blogs are better than mine. Eat my dust you two nameless losers! I pledge to continue my standards of excellence and to grow my rank to at least 1,000,000. As a matter of fact I did almost everything I could for that. Now I have to find 224,255 people to join Technorati with their blogs… Damn this Technorati pyramid scheme! -
OpenWrt GUI: development
I was able to spend several hours this week to work on upcoming OpenWrt GUI. I use Dojo as a foundation. At this point I coded a skeleton, which works as a proof of concept. As soon as I finish putting in AJAX guts, I’ll switch to meaty functionality. Add some nice skin to it and we have our homunculus up and running. Huh? AJAX? No, it’s not Ajax the detergent . No, I didn’t mean Ajax the pro soccer club . "Now I clearly remember that AJAX is a Trojan, and I don’t like Trojans and viruses" — clever, but no. Go see the movie about Greek heroes and the Wooden Horse. And let’s skip "Trojan" discussion altogether — I’m trying to be PG-13 rated. -
TinyMCE 2.0RC3 is out
Once again, let’s grab new version of TinyMCE . -
Testing new cache code
I am running new Django cache code now. If you notice any problems with it (e.g., error messages), please drop me a line at once. My email is at the bottom of the page. -
New TinyMCE config for Django
For a long time I wanted to have two TinyMCE toolbars for Django Admin: One-line toolbar with the most essential tools, which gives a lot of space for inline editing of text. Full-featured toolbar with all tools for full-screen mode. It finally happened. Spocke (the main developer of TinyMCE) helped me to figure out how to do it. I updated my article in Django Wiki with new config file, and removed my notes about space problem (new config file solves it) and flickering (new TinyMCE 2.0 RC2 works perfectly). -
TinyMCE: no flicker!
In my previous post I complained about annoying flickering. Well, I’ve upgraded to TinyMCE 2.0 RC2 and it doesn’t flicker anymore! Run, don’t walk, and upgrade immediatelly! -
OpenWrt GUI
Finally I bit the bullet and decided to implement OpenWrt web-based user interface using Felix Fietkau ’s code. Well, MIPS processors used by OpenWrt units are not race horses and GUI is slow to my taste. Yes, I know that stock firmware is not faster. "Slow" is absolute category for me. How do we combat latencies and slow network speed? Exactly. We can apply the same for OpenWrt, where "slow network speed" is replaced with "slow processor on local network". So I decided to do The Right Thing(tm) and implement it using AJAX approach. I will use Dojo . -
Before Rita
Hurricane Rita was donwgraded to Category 3 storm (125mph/200kph winds). Here in Dallas we expect heavy rains for 2+ days. Sunset was very colorful today. I tried to capture it in this picture: You can find bigger picture on Flickr . -
Code: RSS in Django
Update: "The Simple Way" part of this tutorial is obsolete now. I am going to recreate examples using new improved RSS framework. Stay tuned! I was asked several times to explain how I did RSS for my site. Django has RSS framework, which is not documented. Most probably I am not the right guy to explain it but I’ll try. There are three ways to implement RSS with Django: The Simple: using Django’s RSS framework. The Smart: using django.utils.feedgenerator. The Hard: write a view and output XML manually or using standard xml.sax.saxutils. If you want Django to do everything for you, then you should use "The Simple Way". If you want some custom object selection, you should use "The Smart Way". For obsessed workaholics, S&M adepts, and guys-with-really-convoluted-needs the only way is "The Hard Way". Being lazy I prefer #1 and #2. If you want #3, I suggest you to study files mentioned in "The Simple Way" subsection below. The Simple Way If you look into Django’s code, you will find several files related to RSS: -
allofmp3.com RSS feed
I really love allofmp3.com. It’s really everything a music download service should be: the site is nicely designed, works perfectly, and allows you to download music in whatever codec you prefer. Since you’re charged by the megabyte, you depending on how much fidelity you’d like. An mp3 album at a reasonable bitrate is only about $2 (beat that, Apple!), but if you want a lossless codec you’ll probably pay about $8 - $10. -
Code: my categories
After some requests I decided to publish my code for categories. It’s very simple. It was inspired by following articles: A "category" Data Model (note: this article uses old-style model format, it doesn’t work anymore) and Relating an object to itself, many-to-one . from django.core import meta class Category(meta.Model): """ Category defines following fields: name - simple name of category, e.g., 'C++' full_name - full name of category, which includes names of all parents, e.g. 'Development::C++' parent - reference to parent category or null description - HTML description of category, or null Notes: 1) full_name is not editable. It is calculated automatically by calculate_full_name() method during save phase (hook _pre_save). 2) Separator specified by get_separator() method. It can be overridden in subclasses. """ name = meta.CharField(maxlength=50) full_name = meta.CharField(maxlength=250, unique=True, editable=False) parent = meta.ForeignKey('self', blank=True, null=True, related_name='child') description = meta.TextField(blank=True, null=True, help_text="Use raw HTML.") class META: verbose_name_plural = 'Categories' module_name = verbose_name_plural.lower() admin = meta.Admin( list_display = ('full_name',), search_fields = ['full_name',], js = ( '/tiny_mce/tiny_mce.js', '/appmedia/admin/js/textareas.js', ), ) ordering = ('full_name',) def __repr__(self): return self.full_name def _pre_save(self): self.full_name = self.calculate_full_name() def get_separator(self): return '::' # note: used in templates def get_all_children(self): "get list of all children of the category" output … -
Django badges!
Finally we have official Django badges . Wilson Miner did a great job putting them together. I decided to use this one: How do you like it? If you are a fan of 80 by 15 pixels badges, don’t fret — Dave Hodder has you covered with his rendition of "Made with Django" theme. Collection of his small badges are attached to ticket #509 . Check it out too. -
OpenWrt White Russian RC3 is out
Today is the day of new releases: OpenWrt just released new White Russian RC3 . BTW, contrary to popular belief, it’s not just for Linksys WRT54G . You can run it too, if you have supported hardware . I run it on Buffalo WBR2-G54 . -
TinyMCE 2.0RC2 is out
Wow, they move fast! Go and grab Tiny MCE 2.0RC2 . -
Added RSS
Finally I added RSS 2.0 using Django’s facilities. Default RSS feed is for my blog. Categories have two versions of RSS feed: exclusively for documents of the category, and documents for the category and its children. (I hope it is not news anymore: I have hierarchical categories.) -
DreamHost: no transactions
Update: InnoDB is in the house ! In my previous post I already complained about lack of transaction support by DreamHost. The only database option is MySQL with InnoDB engine, which doesn’t support transactions. Everybody knows that transactions are nice. So what about MySQL/InnoDB or PostgreSQL? So I hit DreamHost forums and found several posts from DreamHost people about PostgreSQL and InnoDB: Re: PostgreSQL rant on 06/02/05 by Jeff @ DreamHost (DH Discussion Forum Admin) Re: PostgreSQL rant on 06/01/05 by Dallas (DreamHost Head Honcho/Founder) Re: mod_proxy support on 04/07/05 by Jeff @ DreamHost (DH Discussion Forum Admin) Re: PostgreSQL on 12/03/04 by will Re: PostgreSQL rant on 10/15/04 by nate Re: PostgreSQL rant on 06/23/04 by Jeff @ DreamHost (DH Discussion Forum Admin) Re: MySQL 4, PostgreSQL on 07/15/03 by will Re: MySQL 4, PostgreSQL on 04/07/03 by Jeff @ DreamHost (DH Discussion Forum Admin) Re: transactions in mysql on 02/11/03 by Jeff @ DreamHost (DH Discussion Forum Admin) So I’ve got the impression that PostgreSQL is out for now, but MySQL/InnoDB is really close to be implemented and offered to customers. I decided to ask the support directly and got two firm answers: MySQL/InnoDB — No, PostgreSQL — … -
Running on 'sql:' cache now
Now this blog runs on sql:. I use MySQL as my backend. Before that I tested it locally with SQLite (so easy to install!) and MySQL. I learned today that MySQL, which is provided by my host (DreamHost ), uses MyISAM for all tables. MyISAM doesn’t support transactions. AT home I use InnoDB, which supports transactions. However the hope is not lost — DreamHost mulls over InnoDB support. But as far as I know, they don’t have an implementation schedule yet.