[Python-talk] Django tutorial issues.

Bill Freeman f at ke1g.mv.com
Sat Jun 23 19:17:37 EDT 2007

Has anyone gone through the django tutorial?

How about on django 0.95 (0.95.1 being what's available via apt on ubuntu feisty

It all works as advertised, even though I was reading the version of the tutorial
for the subversion release, rather than for 0.95, until the very last stuff on
the fourth and final page of the turorial, and even most of that is good.  The
url to pass to HttpResponseRedirect(), however, is an issue.  The tutorial (even
the 0.95 version of the tutorial, unless I mis-read it) is silent on fixing this
up.  reverse() can't deal with the missing results() view function as a basis for
figuring out the url, and I can't blame it.

If I hard the url as:

     '/polls/%d/results/' % p.id

everything works.  But that's putting an absolute path into the code, so it
wouldn't "plug in" elsewhere without modification.

It seems that the named pattern stuff (fourth member of the url dispatch tuple
in */urls.py) is the ideal way to fix this, since the reverse() doc says that
it can take one of those.  But these aren't supported in 0.95, or even 0.96.
They are new in the subversion release.

I'm considering raising a ticket against the 0.95 (and maybe 0.96) version(s)
of the tutorial, but I figured that I'd troll the sig first (I don't see a
django mailing list on the django site), and embarrass myself among friends


More information about the Python-talk mailing list