I have installed Django and created a new project using the following commands:
mkdir trydjango
cd trydjango
virtualenv -p python3 .
source bin/activate
pip install django==2.0.7
When I run pip freeze
, I see the following:
Django==2.0.7
pkg-resources==0.0.0
pytz==2018.9
Inside my virtualhost I have the following:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName django.mydomain.com
ServerAlias www.django.mydomain.com
DocumentRoot /var/www/django.mydomain.com
ErrorLog ${APACHE_LOG_DIR}/django.mydomain.com.error.log
CustomLog ${APACHE_LOG_DIR}/django.mydomain.com.access.log combined
<Directory root/Dev/trydjango/src/trydjango>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess trydjango python-home=root/Dev/trydjango/bin python-path=root/Dev/trydjango/
WSGIProcessGroup trydjango
WSGIScriptAlias / /root/Dev/trydjango/src/trydjango/wsgi.py
</VirtualHost>
But when I try to access my domain, it time outs. When I access the Apache error log for the domain the following error message is present:
[pid 12746] [client xx.xx.xx.xxx:60684] Timeout when reading response headers from daemon process 'trydjango': /root/Dev/trydjango/src/trydjango/wsgi.py
How can I fix this timeout problem?
I've chowned wsgi.py to www-data:www-data I've also made the folder the app is in exectuable
Not sure what else to try with this brand new project to get wsgi working.
I found this: Django Webfaction 'Timeout when reading response headers from daemon process'
and added WSGIApplicationGroup %{GLOBAL}
to the virtualhost and also to apache2.conf but this didn't fix the problem.