I am trying to setup a simple Django app using this tutorial:
My configuration is:
Ubuntu 12.04, Apache/2.4.7, libapache2-mod-wsgi-py3, Python 3.4, Django 1.86
I keep getting the following error in the apache log whenever I try to access the server using its IP:
ImportError: No module named 'encodings'
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
[Sat Nov 07 01:26:56.505373 2015] [core:notice] [pid 20920:tid 140075144152960] AH00051: child pid 21716 exit signal Aborted (6), possible coredump in /etc/apache2
[Sat Nov 07 01:26:56.505478 2015] [core:notice] [pid 20920:tid 140075144152960] AH00051: child pid 21717 exit signal Aborted (6), possible coredump in /etc/apache2
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
My virtual hosts file looks as follows:
<VirtualHost *:80>
ServerAdmin
Alias /static /home/admin/myproject/static
<Directory /home/admin/myproject/static>
Require all granted
</Directory>
<Directory /home/admin/myproject/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myproject python-path=/home/admin/myproject:/home/admin/myproject/myprojectenv/lib/python3.4/site-packages
WSGIProcessGroup myproject
WSGIScriptAlias / /home/admin/myproject/myproject/wsgi.py
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Note: There were no errors while setting up Django in the virtualenv. It may be a problem with the PythonPath, buI think I have specified it correctly via the python-path option in the WSGIDaemonProcess directive.