title: Unable to get the locale encoding in Ubuntu 14.04, Apache/2.4.7, libapache2-mod-wsgi-py3, Python 3.4 virtualenv, Django 1.86
body: <p>I am trying to setup a simple Django app using this tutorial:
  <a href="https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04" rel="nofollow">https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04</a></p>
  
  <p>My configuration is:
  Ubuntu 14.04, Apache/2.4.7, libapache2-mod-wsgi-py3, Python 3.4, Django 1.86</p>
  
  <p>I keep getting the following error in the apache log whenever I try to access the server using its IP:</p>
  
  <pre><code>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'
  </code></pre>
  
  <p>My virtual hosts file looks as follows:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;  
  
      ServerAdmin 
      ServerName example.com
      ServerAlias www.example.com
      DocumentRoot /var/www/example.com/public_html
  
      Alias /static /home/admin/myproject/static
      &lt;Directory /home/admin/myproject/static&gt;
          Require all granted
      &lt;/Directory&gt;
  
      &lt;Directory /home/admin/myproject/myproject&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;
  
      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    
  
  &lt;/VirtualHost&gt;  
  </code></pre>
  
  <p>There were no errors while setting up Django in the virtualenv.</p>