Monday, June 25, 2012

Re: WSGI help required. Getting a 'No module named myFirstProject.wsgi' error.

Hi 

My code looks like this...see below.  fails on last line. i.e. runfastcgi(method="threaded", daemonize="false")

Python Code is run from this path /home1/harveywe/www/dj/testProject/mySite.fcgi

environments 
PYTHONPATH=/home1/harveywe/.local/lib/python2.6/site-packages:/home1/harveywe/
PATH=/home1/harveywe/.local/bin:/home1/harveywe/.local/usr/bin:/usr/local/jdk/  bin:/home1/harveywe/perl5/bin:/usr/lib64/qt-3.3/bin:/home1/harveywe/perl5/bin:  /ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr  

This code being run on a ISP host (bluehost.com). 

Does any of this help?

Harevy


########################### MY CODE ##############################
harveywe@harveywest.co.uk [~/www/dj/testProject]# cat mySite.fcgi
#!/usr/bin/python2.6
import sys, os

# Add a custom Python path.
sys.path.insert(0, "/home1/harveywe/.local/lib/python2.6")
sys.path.insert(13, "/home1/harveywe/django_projects/myFirstProject")


sys.path.insert(0, "/home1/harveywe/.local/lib/python2.6/flup-1.0.2")


# Switch to the directory of your project. (Optional.)
# os.chdir("/home/DJANGONOOB/django_projects/myFirstProject")

#from django.conf import settings

#settings.DEBUG = True




# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
#################### MY CODE END #######################################




On Tuesday, 29 May 2012 22:12:27 UTC+1, Harvey wrote:
Setting up django for the first time

Any ideas what i need to look at to get this error to go away. Not
used "wsgi" before?


~/www/django/mySite.fcgi

Traceback (most recent call last):
  File "./mySite.fcgi", line 19, in <module>
    runfastcgi(method="threaded", daemonize="false")
  File "/home1/harveywe/.local/lib/python2.6/site-packages/django/core/
servers/fastcgi.py", line 182, in runfastcgi
    WSGIServer(get_internal_wsgi_application(), **wsgi_opts).run()
  File "/home1/harveywe/.local/lib/python2.6/site-packages/django/core/
servers/basehttp.py", line 60, in get_internal_wsgi_application
    "could not import module '%s': %s" % (app_path, module_name, e))
django.core.exceptions.ImproperlyConfigured: WSGI application
'myFirstProject.wsgi.application' could not be loaded; could not
import module 'myFirstProject.wsgi': No module named
myFirstProject.wsgi

I'm assume this explains why i'm getting "HTTP Error 500 Internal
server error"

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

No comments:

Post a Comment