On 21 January 2011 09:31, cocobuster <[email protected]> wrote: > Hi, > > after creating the new dir for my project and trying to run > http://127.0.0.1/mysite, I am getting a 500, > the apache log file says: > NameError: name 'django' is not defined > [error] [client 127.0.0.1] ImportError: No module named > django.core.handlers.wsgi > > ----- django.wsgi File Content----------- > import os, sys > sys.path.append('/Users/corinemorin/www/webapps') > sys.path.append('/Users/corinemorin/www/webapps//mysite') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > import django.core.handlers.wsgi > > application = django.core.handlers.wsgi.WSGIHandler() > > > Why is django.wsgi unable to "import django.core.handlers.wsgi"?
Because it isn't installed into the specific Python installation you are using. Do you have multiple Python installations on your system? Apache/mod_wsgi may be compiled against and using different one to what you have been using with development server. Are you using a virtual environment and did you install Django into the virtual environment instead of Python installations own site-packages directory? If you did, you need to tell mod_wsgi about the virtual environment. See http://code.google.com/p/modwsgi/wiki/VirtualEnvironments When you installed Django, did Django get installed with permissions such that other users can access it? Apache runs as a special user and like you were having permission issues with your own directories/files, if Django has restrictive permissions the Apache user will not be able to find it. Graham > thanks for your help, > Corine > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" 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/modwsgi?hl=en. > -- You received this message because you are subscribed to the Google Groups "modwsgi" 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/modwsgi?hl=en.
