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

1,052 views
Skip to first unread message

Harvey

unread,
May 29, 2012, 5:12:27 PM5/29/12
to Django users
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"

Marcin Tustin

unread,
May 29, 2012, 5:27:03 PM5/29/12
to django...@googlegroups.com
Maybe you should actually show us the code, and tell us about your environment. 


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




--
Marcin Tustin
Tel: 07773 787 105

Harvey

unread,
Jun 25, 2012, 9:09:50 AM6/25/12
to django...@googlegroups.com
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 ##############################
harv...@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 #######################################
Reply all
Reply to author
Forward
0 new messages