Have a read of:

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

In particular where it says:

"""
If you have been using the Django development server and have made use
of the fact that it is possible when doing explicit imports, or when
referencing modules in 'urls.py', to leave out the name of the site
and use a relative module path, you will also need to add to sys.path
the path to the site package directory itself.

sys.path.append('/usr/local/django')
sys.path.append('/usr/local/django/mysite')

In other words, you would have the path to the directory containing
the 'settings.py' file created by 'django-admin.py startproject', as
well as the parent directory of that directory, as originally added
above.

Note that it is not recommended to be setting 'DJANGO_SETTINGS_MODULE'
to be 'settings' and only listing the path to the directory containing
the 'settings.py' file. This is because such a setup will not mirror
properly how the Django development server works and everything may
not work as expected.
"""

You have only added the path to the parent directory and not the path
of the directory containing the settings.py file. Your use of relative
modules references within the site package may therefore be a problem.

Graham

On Dec 2, 9:43 am, neridaj <neri...@gmail.com> wrote:
> I'm using the same setup I have for another django site running on the
> same server. I haven't had to use the python-path arg to WDP before so
> I'm not sure how to do that. I'm still pretty new to this so any help
> would be much appreciated. I'm using the same wsgi script that works
> for the other site so I don't see any problem but here it is if you
> want to have a look:
>
> import os, sys
>
> path = '/home/username/public_html/mysite.com/'
> if path not in sys.path:
>     sys.path.append(path)
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
> import django.core.handlers.wsgi
>
> _application = django.core.handlers.wsgi.WSGIHandler()
>
> def application(environ, start_response):
>     environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME',
> 'http')
>     return _application(environ, start_response)
>
> On Dec 1, 1:53 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote:
>
>
>
> > Are you using python-path arg to WDP?  Also, you might do some
> > sys.path hacking in the .wsgi script.
>
> > neridaj wrote:
> > > Hello,
>
> > > I'm trying to deploy my project to my server and I don't understand
> > > why django isn't finding modules I've added to my pythonpath. When I
> > > try to access my site I get 500 errors and after looking at the server
> > > log I see a traceback with this:
>
> > > [error] [client 174.xxx.xxx.xxx] ImportError: No module named blog
>
> > > However, when I run python I am able to import the modules. I'm using
> > > nginx as a proxy to apache2/mod_wsgi on Ubuntu 9.04.
>
> > > Thanks,
>
> > > J

--

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


Reply via email to