I'm running django on ubuntu jaunty-9.04, apache2/mod_wsgi, and nginx.
I'm having problems with both of my vhosts resolving to the same
document root, as well as 500 errors with one of the domains. my first
domain works fine i.e., the url resolves to the correct document root,
but when I look up the other vhost I have problems. I think the second
vhost might be having problems because it is defined second in the
order in the apache vhosts. If I look up the second vhost without www
prepended to the url I get 500 errors with the following in the server
log:

    [client 174.xxx.xxx.xxx] ImportError: No module named tagging

when I import the tagging module from python it imports with no
errors. My vhost for the domain in question is as follows:

/etc/apache2/sites-available/mysite.com:

<VirtualHost *:8081>

  ServerName mysite.com
  ServerAdmin supp...@mysite.com
  ServerAlias *mysite.com

  WSGIScriptAlias / /home/username/public_html/mysite.com/mysite.wsgi

  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/username/public_html/mysite.com/logs/error.log
  CustomLog /home/username/public_html/mysite.com/logs/access.log
combined

  RPAFenable On
  RPAFsethostname On
  RPAFproxy_ips 127.0.0.1

</VirtualHost>

/etc/nginx/sites-available:

server {
        listen       80;
        server_name  mysite.com; # ex: www.mysite.com

        location / {
            proxy_pass         http://mysite.com:8081;
            include /etc/nginx/proxy.conf;
        }

        # Static files location, requires that you create this folder
separately
        location /site_media/ {
            root   /home/username/public_html/mysite.com/;
        }

        # Admin templates location
        location /admin_media/ {
            root   /home/username/public_html/mysite.com/;
        }

    }

Public_html/mysite.com/mysite.wsgi:

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 Nov 30, 9:23 pm, neridaj <neri...@gmail.com> wrote:
> Hello,
>
> I'm trying to deploy my simple app and I've mirrored the project as it
> was on my local dev machine. For some reason, when I try to browse to
> the url I get a 500 error and the error log says ImportError: No
> module named tagging. I've added PYTHONPATH env vars as follows:
>
> export PYTHONPATH=/home/username/public_html/mysite.com/:$PYTHONPATH
> export PYTHONPATH=/home/username/public_html/mysite.com/mysite:
> $PYTHONPATH
> export PYTHONPATH=/home/username/public_html/mysite.com/mysite/blog:
> $PYTHONPATH
> export PYTHONPATH=/home/username/public_html/mysite.com/mysite/project:
> $PYTHONPATH
> export PYTHONPATH=/home/username/public_html/mysite.com/mysite/search:
> $PYTHONPATH
> export PYTHONPATH=/home/username/public_html/mysite.com/mysite/akismet:
> $PYTHONPATH
> export PYTHONPATH=/home/username/src/akismet-0.2.0:$PYTHONPATH
> export PYTHONPATH=/home/username/src/django-tagging-0.3:$PYTHONPATH
> export PYTHONPATH=/home/username/src/Markdown-2.0.3:$PYTHONPATH
> export PYTHONPATH=/home/username/src/pydelicious
> +tools-0.5.3:$PYTHONPATH
> export DJANGO_SETTINGS_MODULE=mysite.settings
>
> when I print sys.path tagging is on the path and when I import tagging
> from python I get no errors. I've been doing dev on osx, is there some
> different syntax to properly add to PYTHONPATH on ubuntu?
>
> 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