Having problems getting contrib.markup to load

599 views
Skip to first unread message

Michael Lake

unread,
Mar 21, 2007, 9:29:39 PM3/21/07
to django...@googlegroups.com
Hi all

I'm doing something wrong, probably simple too, in trying to get the contrib.markup
running.

I have in settings.py 'django.contrib.markup'
In a template I have {% load markup %}

I thought the above was all I need.
When the URL is accessed I get a traceback like this:

Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 272,
in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 614,
in __call__
return self.application(environ, start_response)
File "/usr/lib/python2.3/site-packages/django/core/handlers/wsgi.py", line 184, in
__call__
self.load_middleware()
File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 35, in
load_middleware
raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not define a
"%s" class' % (mw_module, mw_classname)
ImproperlyConfigured: Middleware module "django.contrib" does not define a "markup" class

and on a subsequent reload of the page I get this HTML page:

TemplateSyntaxError at /testwiki/
'markup' is not a valid tag library: Could not load template library from
django.templatetags.markup, No module named markup
Exception Type: TemplateSyntaxError
Exception Value: 'markup' is not a valid tag library: Could not load template
library from django.templatetags.markup, No module named markup
Exception Location: /usr/lib/python2.3/site-packages/django/template/defaulttags.py
in load, line 721

In template templates/lab/testwiki.html, error at line 4
'markup' is not a valid tag library: Could not load template library from
django.templatetags.markup, No module named markup
1 {% extends "lab/base.html" %}
2 {% block content %}
3 {% load markup %}
4


I can see that markup.py exists in
/usr/lib/python2.3/site-packages/django/contrib/markup/templatetags/markup.py

I searched this mailing list for a few things and got some hits like this:
http://groups.google.com/group/django-users/browse_thread/thread/67f702f85e66de72/aa735b7e29039693?lnk=gst&q=markup&rnum=4&hl=en#aa735b7e29039693
which led me to add to views.py
from django.contrib.markup.templatetags import markup

But I am still getting the same errors.

Mike
--
Michael Lake

d...@simon.net.nz

unread,
Mar 22, 2007, 12:14:08 AM3/22/07
to Django users
Hi Michael,

Have you added "django.contrib.markup" to your INSTALLED_APPS setting?

--Simon

Michael Lake

unread,
Mar 22, 2007, 12:20:20 AM3/22/07
to django...@googlegroups.com
si...@simon.net.nz wrote:
> Hi Michael,
> Have you added "django.contrib.markup" to your INSTALLED_APPS setting?

Ah :-)
I had placed django.contrib.markup into the MIDDLEWARE_CLASSES instead of the
INSTALLED_APPS section in settings.py.

I have fixed that and it's now saying the markdown library is not installed which is
much much better. I have to get and install that and then I think I should be running
fine.

Thanks
--
Michael Lake

Reply all
Reply to author
Forward
0 new messages