I'm unable to deploy my django site using mod_wsgi after a a few frustrating days of trying. Could someone sanity check these details and see if there's anything obviously wrong? This is my first Django deployment. Its been running file with python manage.py runserver 10.10.10.214:8080 but I cannot deploy
my wsgi.py file in /home/user/django/mysite (also where my settings.py etc are)
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
my apache .conf file:
LoadModule wsgi_module /home/conf/apache2/modules/mod_wsgi.so #dont read into the locations too much - they are correct
WSGIScriptAlias / /home/user/django/mysite/wsgi.py
WSGIPythonPath /home/user/django
<Directory /home/user/django/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
I am forced to use a heavily pre-customized version of apache but the conf file above is included. Any help at all would be great.
Cheers, Arthur
/home/userwould often have restrictive permissions and not be accessible to other users. Thus it isn't enough just to make the Django project directory accessible. The home directory would also need to be accessible to the user that Apache runs as. It may be better to move the project out of your user account so you aren't mucking with the account permissions.