2

Setting up my first app. I started on the django development server, and am now moving things to an apache setup so that I can code in my target prod environment. I've gotten mod_wsgi set up successfully and got a successful "Hello World!". Now I'm having issues actually getting my app to respond in apache the way it did in the django dev server.

Here's my directory structure:

  • /var/www/www.example.com/ [site directory]

    • Example [my app]

      • wsgi.py

      • settings.py

    • users [another django module i wrote]

    • trips [yet another django module i wrote]

Now, in my virtual host file, I have the following line: WSGIScriptAlias / /var/www/www.example.com/Example/wsgi.py

And in my wsgi.py file, I have the following lines:

sys.path.append('/var/www/www.example.com/Example')
sys.path.append('/var/www/www.example.com/trips')
sys.path.append('/var/www/www.example.com/users')

Yet, here's the error I'm getting:

[Sun Jan 06 21:37:46 2013] [error] [client 127.0.0.1] ImportError: No module named trips

What do I need to do to get django and mod_wsgi to recognize my trips and users apps?

Thanks!

wampum
  • 43
  • 5
  • Possible duplicate: http://stackoverflow.com/questions/5841531/django-mod-wsgi-apache-importerror-at-no-module-named-djproj-urls – Ahsan Jan 07 '13 at 07:40

1 Answers1

0

don't add every module to sys.path. Instead you should add /var/www/www.example.com to sys.path.

frog32
  • 966
  • 7
  • 19