Copied django project to shared host from repo - can't import settings

62 vistas
Ir al primer mensaje no leído

Lee

no leída,
24 jun 2014, 5:39:38 p.m.24/6/2014
para django...@googlegroups.com
Hello,

I setup Django successfully on my shared Bluehost account following the tutorial below: http://www.nyayapati.com/srao/2012/08/setup-python-2-7-and-django-1-4-on-bluehost/

I am now having problems with a Django project I have copied from a GitHub repo to my Bluehost directory. I am getting this error when I run python mysite.fcgi in my virtualenv

go-1.5.1-py2.7.egg/django/conf/__init__.py", line 134, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'mysite.settings' (Is it on sys.path?): No module named settings

Any thoughts on where to look for errors? I have checked .htaccess and the mysite.fcgi file in my www directory, the pointer to settings in my manage.py and these seem as they should be. Running python manage.py runserver on the project says there are no errors.

Lee

carlos

no leída,
24 jun 2014, 9:23:17 p.m.24/6/2014
para django...@googlegroups.com
Hi, maybe show the content mysite.fcgi and .htaccess, the error say not exist your project mysite
maybe the path is not good in mysite.fcgi!

Cheers


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/595e7cff-5af9-4c63-a052-41d3ce472e30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lee

no leída,
24 jun 2014, 11:51:19 p.m.24/6/2014
para django...@googlegroups.com
For mysite.fcgi I have: 

#!/home5/myorg/.virtualenvs/mydjango/bin/python
import sys, os

# Add a custom Python path.
sys.path.insert(0, "/home5/myorg/.virtualenvs/mydjango")
sys.path.insert(13, "/home5/myorg/django_projects/mysite")
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

and for .htaccess I have - 

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

Thanks,
Lee

carlos

no leída,
25 jun 2014, 11:14:46 a.m.25/6/2014
para django...@googlegroups.com
ok i make different configuration

#!/home5/myorg/.virtualenvs/mydjango/bin/python
import sys, os

# Add a custom Python path.
sys.path.insert(0, "/home/<user_name>/projects/")
sys.path.insert(0, "/home/<user_name>/projects/yourproyect")

from flup.server.fcgi import WSGIServer
os.environ['DJANGO_SETTINGS_MODULE'] = '<project_name>.settings'
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()

Cheers


Lee

no leída,
25 jun 2014, 12:03:28 p.m.25/6/2014
para django...@googlegroups.com
This worked, thank you! I don't understand why it worked, but pleased that it did.

Lee
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos