Invalid block tag: 'with'

62 views
Skip to first unread message

bcrem

unread,
May 27, 2008, 2:23:58 PM5/27/08
to Django users
Hi all,

I'm trying to use the 'with' tag in an html template, similar to
below:

{% with package.view.object as f %}
{{ f.name }}
...
{% endwith %}

When I try this, however, I get a TemplateSyntaxError whose exception
value reads:

Invalid block tag: 'with'

and my {% with ... %} is highlighted as the offending line.

Has anyone else run into this? Does the 'with' block tag work? This
is my first month with Django (& Python); I've managed to sort out
previous problems in the examples I'm running through, but I'm not
sure if this one is me (likely) or Django (?).

Thanks in advance for any info...

bcrem

Karen Tracey

unread,
May 27, 2008, 2:59:23 PM5/27/08
to django...@googlegroups.com

What version of Django are you running?  The with tag is marked "New in Django development version" so you'll need to be running something more recent than an 0.96.x release to have it work.

Karen

bcrem

unread,
May 27, 2008, 3:14:42 PM5/27/08
to Django users
That must be it Karen - I'm running 0.96.2. Guess I'll have to wait
for the next release (or be brave and install the dev version...).

Thanks for your help.

bcrem

On May 27, 2:59 pm, "Karen Tracey" <kmtra...@gmail.com> wrote:

Karen Tracey

unread,
May 27, 2008, 3:22:37 PM5/27/08
to django...@googlegroups.com
On Tue, May 27, 2008 at 3:14 PM, bcrem <bill...@gmail.com> wrote:

That must be it Karen - I'm running 0.96.2.  Guess I'll have to wait
for the next release (or be brave and install the dev version...).

Thanks for your help.

I'd recommend installing the SVN version.  If you are just getting started and thus don't have a lot of existing code where you need to be concerned about backwards-incompatible changes since 0.96, then I see no reason to start learning with the old release.  SVN trunk is quite stable, and has a year's worth of enhancements and fixes beyond what is in 0.96. 

Karen

bcrem

unread,
May 27, 2008, 3:56:31 PM5/27/08
to Django users
I think I'll check my target host server; I'm starting work on a site
that's to be hosted on GoDaddy - have to see what they're running.
And if their tech-support is worthy of the name; first guy I spoke
with there had to go offline a good five minutes to look up 'Django'.

Hmmm. On hold with them again (past the five-minute mark already);
today's helpful phone-jockey insists Django's not in their knowledge
base at all, he doesn't think they support it. This could be bad...

Good hold music at GoDaddy though; that's a nice change.


On May 27, 3:22 pm, "Karen Tracey" <kmtra...@gmail.com> wrote:

phillc

unread,
May 28, 2008, 10:21:25 AM5/28/08
to Django users
"I'm starting work on a site that's to be hosted on GoDaddy"

uh.... good luck
Reply all
Reply to author
Forward
0 new messages