Tuesday, June 24, 2014

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

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

On Tuesday, June 24, 2014 9:23:17 PM UTC-4, sacrac wrote:
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


On Tue, Jun 24, 2014 at 3:39 PM, Lee <lcps...@gmail.com> wrote:
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

--
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.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/d31f24ec-601b-4b4a-8d83-05d7048c442c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment