I get an 500 internal server error and in the log files it writes:
[Thu Jun 14 16:30:22 2012] [error] [client 127.0.0.1] ImportError: Could not import settings 'mysite.settings' (Is it on sys.path?): No module named mysite.settings
here is my httpd.conf:
ServerName localhost
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite/
LogLevel warn
WSGIDaemonProcess processes=2 maximum-requests=500 threads=1
WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py
Alias /media /var/www/mysite/mysite/static/media/
</VirtualHost>
wsgi.py:
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
This problem is covered in both the mod-wsgi documentation http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango and the Django deployment documentation https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/ which note that the project must be on your Python path. You can use the WSGIPythonPath
directive or set the python-path
in your WSGIDaemonProcess
directive from the Django documentation. Or you can add it to the sys.path
in your wsgi file as the mod-wsgi docs state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With