Hi, I spent 2 days on this error. could not figure it out.
an 21 00:19:50 2011] [error] [client 127.0.0.1] ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
django.wsgi is located in / user / local / django / apache
import os, sys
sys.path.append('/usr/local/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
my django project named mysite: is located in / user / local / django / mysite / scr / (there are settings.py init.py here, etc.)
apache conf
Alias /media/ /usr/local/django/media
<Directory /usr/local/django/media>
Order deny,allow
Allow from all
</Directory>
<Directory /usr/local/django/apache/>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /usr/local/django/apache/django.wsgi
I changed the mysite folder above with a resolution of 777 to avoid any resolution problems. and every time I restart the httpd service.
apache launches and finds django.wsig. but he cannot find the settings file specified in it.
and I will add the path to $ PATH manually and repeat it. it's over there. and I restart httpd. the path that I added disappeared ...
Does anyone know what is going on?
thank
source
share