I am new to working with Django based applications and trying to deploy a django project using following configurations, which are almost similar to the default given on django docs.
apache2.conf
# WSGI Configuration
WSGIDaemonProcess demo python-path=/home/inian/Documents/demo
WSGIProcessGroup demo
WSGIScriptAlias / /home/inian/Documents/demo/demo/wsgi.py process-group=demo
<Directory /home/inian/Documents/demo/demo>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
# Serving static files
Alias /static/ /home/inian/Documents/demo/static/
<Directory /home/inian/Documents/demo/static>
Require all granted
</Directory>
When I start the apache server, it starts normally but gives runtime error for loading my project because of python version mismatch indicated as bellow.
/var/log/apache2/error.log
[Sun Apr 10 20:38:16.165536 2016] [wsgi:warn] [pid 22959] mod_wsgi: Compiled for Python/2.7.11.
[Sun Apr 10 20:38:16.165551 2016] [wsgi:warn] [pid 22959] mod_wsgi: Runtime using Python/2.7.10.
[Sun Apr 10 20:38:16.166787 2016] [mpm_prefork:notice] [pid 22959] AH00163: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f mod_wsgi/4.5.1 Python/2.7.10 configured -- resuming normal operations
I want my application to use the python installed in location /usr/local which is version 2.7.11 and this is the one I used to compile and install mod_wsgi, however just to be safe I also checked /usr/bin/python -V which gives output as Python 2.7.6. This brings use to two issues:
How can I point apache to use Python 2.7.11 from the installation location
/usr/local/bin/python(which I have been using as default for all things on the server).I do not remember ever installing or doing anything with 2.7.10, so I do not know how and from where is it being loaded and used by apache. If someone can guide me towards that, then it will be great as well.
pyUnicodeUCS4_AsEncodedString, which I took care of in my 2.7.11 installation. So yeah I do need to use the correct python version which I have installed in location/usr/locallocationpyUnicodeUCS4_AsEncodedStringerror occurs because that unknown 2.7.10 version picked up by the apache server is not properly compiled for unicode 4 support.