how to import a library in only in django project

0 views
Skip to first unread message

Amit Sethi

unread,
Nov 25, 2009, 3:59:15 AM11/25/09
to django...@googlegroups.com

Hi ,
I want to use a library in a django project but I don't want to put it in python path. Where am I supposed to put the sys.append so that it will available to the whole django project.
--
A-M-I-T S|S

Tim Sawyer

unread,
Nov 25, 2009, 8:59:14 AM11/25/09
to django...@googlegroups.com
Hi Amit,

It depends how you're running.

If you're using ./manage.py testserver, then change manage.py to add in
your new path.

If you're using mod-wsgi, then change the site-wsgi.py file:

import os, sys
sys.path.append('/home/path/to/add')
os.environ['DJANGO_SETTINGS_MODULE'] = 'MySite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Hope that helps,

Tim.
> --
>
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
0 new messages