restructuredtext filter

84 views
Skip to first unread message

chris....@gmail.com

unread,
Dec 12, 2005, 1:10:53 PM12/12/05
to Django users
I was previously using the 0.90 Egg file, and I got the
restructuredtext filter working by adding:

from django.contrib.markup.templatetags import markup

into my views.py file for my app. Then I could say someting like:

article.content|restructuredtext

in my .html file, and it worked.

Today, I moved to the development version of django using svn. I have
everything working like before except the restructuredtext filter. I
have tried the same as above, and also changing the import line to

from django.contrib.markup.templatetags.markup import restructuredtext

But that still doesn't work. Any ideas?

Thanks

James Bennett

unread,
Dec 12, 2005, 1:15:25 PM12/12/05
to django...@googlegroups.com
On 12/12/05, chris....@gmail.com <chris....@gmail.com> wrote:
> Today, I moved to the development version of django using svn. I have
> everything working like before except the restructuredtext filter. I
> have tried the same as above, and also changing the import line to

Do you have the tag {% load markup %} in your template?


--
"May the forces of evil become confused on the way to your house."
-- George Carlin

chris....@gmail.com

unread,
Dec 12, 2005, 1:28:59 PM12/12/05
to Django users
I do now!

I had to copy django/contrib/markup/templatetags/markup.py to
django/templatetags and the with the {% load markup %} line the filter
works now.

Thank you for your help!

Jacob Kaplan-Moss

unread,
Dec 12, 2005, 1:33:42 PM12/12/05
to django...@googlegroups.com
On Dec 12, 2005, at 12:28 PM, chris....@gmail.com wrote:
> I had to copy django/contrib/markup/templatetags/markup.py to
> django/templatetags and the with the {% load markup %} line the filter
> works now.

You don't have to do that either.

Just put "django.contrib.markup" in your INSTALLED_APPS setting, then
{% load markup %} will work. See http://www.djangoproject.com/
documentation/templates/#custom-tag-and-filter-libraries for more
information.

Jacob

chris....@gmail.com

unread,
Dec 12, 2005, 1:56:31 PM12/12/05
to Django users
Even better.

Thanks again!

Reply all
Reply to author
Forward
0 new messages