Okay,

On our production server we used apt-get to install django and python-
dateutil. In an attempt to avoid having to add the path to every wsgi
settings file I tried several things:

I put a symbolic link called dateutil from /usr/lib/python2.5/site-
packages  to /usr/share/python-support/python-dateutil/dateutil
I put a symbolic link called dateutil in our /home/code/ directory
which is added to the path in wsgi settings to /usr/share/python-
support/python-dateutil/dateutil
I copied the python-dateutil directory to  /usr/lib/python2.5/site-
packages as python-dateutil
I movied the dateutil directory to /usr/lib/python2.5/site-packages as
dateutil

Finally I added /usr/share/python-support/python-dateutil/dateutil in
the wsgi settings file and it began working.

This is an awful solution though if we have to add an insert clause
into every wsgi file in order to get a pluggable app to work.


On Jan 14, 12:12 pm, newspaper-django-lackey
<[email protected]> wrote:
> I've had a breakthrough. Evidently some packages that are on the
> python path for the interpreter are not available to my django wsgi
> settings file. I had to put the exact path to parser.py in my wsgi
> setting file in order to import it and then import parser.
>
> I'm going to investigate whether this is a permissions issue or
> something more subversive.
>
> On Jan 14, 11:07 am, newspaper-django-lackey
>
> <[email protected]> wrote:
> > I'm attempting to use python-dateutil to parse the date output from
> > Feedparser, but continue to get an error when importing the parser.
>
> > I'm building a quick filter in a timeutil.py file in a templatetag
> > folder on the pythonpath
>
> > from dateutil.parser import parse
> > def parsefeedtime(value):
> >     """Use this to parse the date info out of feedparser when using
> > the parse_feed or include_feed tags"""
> >     date_published = parse(value)
> >     return date_published
>
> > I continue to get the error
>
> > "Could not load template library from django.templatetags.timeutiladd,
> > No module named parser"
>
> > I've installed the dateutil via commandline, I deleted the egg and
> > reinstalled using easy_install, but I keep getting the error.
>
> > When I run the function from the python interpreter, it work
> > perfectly.
>
> > >>> from dateutil.parser import parse
> > >>> value='Thu, 14 Jan 2010 16:51:27 GMT'
> > >>> x = parse(value)
> > >>> print x
>
> > 2010-01-14 16:51:27+00:00
>
> > I have no idea why it would work from the python interpreter, but not
> > from a django templatetag file.
>
> > thanks,
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to