title: Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11
body: <p><strong>How do I get mod_wsgi for Apache2 that was compiled for Python 3.6.1?</strong> </p>
  
  <p>(or any future Python version)</p>
  
  <p>I am using a Python 3.6.1 virtual environment with Django 1.11 and Everything is working according to the Apache error log except that mod_wsgi for Apache 2.4 was compiled for Python/3.5.1+ and is using Python/3.5.2 so my Python 3.6.1 code is failing because I'm using new features not available in 3.5.2</p>
  
  <p>All of the other configurations and installs involved in setting my system up seem to be fine (Running in daemon mode) though mod_wsgi doesn't seem to be using my Python 3.6.1 virtual environment (though it is trying to use it for Django according to the error log)...</p>
  
  <p><strong>I used:</strong> <code>sudo apt-get install libapache2-mod-wsgi-py3</code> to install mod_wsgi for Apache 2.4</p>
  
  <p><strong>I used:</strong> <code>./configure --with-python=/usr/local/bin/python3.6</code> and <code>make</code> with <code>make install</code> to install mod_wsgi for Python 3.6</p>
  
  <p><em>I must be doing something wrong - please correct me!</em></p>
  
  <p>Here is my Apache Error Log (cleaned a bit) - and yes I know it fails on the f"" string line (python 3.6 feature not in 3.5) </p>
  
  <pre><code>[wsgi:warn] mod_wsgi: Compiled for Python/3.5.1+.
  [wsgi:warn] mod_wsgi: Runtime using Python/3.5.2.
  [wsgi:warn] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations
  [wsgi:warn] AH00094: Command line: '/usr/sbin/apache2'
  [wsgi:error] mod_wsgi (pid=12963): Target WSGI script '/home/jamin/www/dev.tir.com/tir/tir/wsgi.py' cannot be loaded as Python module.
  [wsgi:error] mod_wsgi (pid=12963): Exception occurred processing WSGI script '/home/jamin/www/dev.tir.com/tir/tir/wsgi.py'.
  [wsgi:error] Traceback (most recent call last):
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/tir/tir/wsgi.py", line 21, in &lt;module&gt;
  [wsgi:error]     application = get_wsgi_application()
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
  [wsgi:error]     django.setup(set_prefix=False)
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
  [wsgi:error]     apps.populate(settings.INSTALLED_APPS)
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/apps/registry.py", line 116, in populate
  [wsgi:error]     app_config.ready()
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 23, in ready
  [wsgi:error]     self.module.autodiscover()
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
  [wsgi:error]     autodiscover_modules('admin', register_to=site)
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
  [wsgi:error]     import_module('%s.%s' % (app_config.name, module_to_search))
  [wsgi:error]   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
  [wsgi:error]     return _bootstrap._gcd_import(name[level:], package, level)
  [wsgi:error]   File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
  [wsgi:error]   File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
  [wsgi:error]   File "&lt;frozen importlib._bootstrap&gt;", line 958, in _find_and_load_unlocked
  [wsgi:error]   File "&lt;frozen importlib._bootstrap&gt;", line 673, in _load_unlocked
  [wsgi:error]   File "&lt;frozen importlib._bootstrap_external&gt;", line 665, in exec_module
  [wsgi:error]   File "&lt;frozen importlib._bootstrap&gt;", line 222, in _call_with_frames_removed
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/tir/company/admin.py", line 13, in &lt;module&gt;
  [wsgi:error]     from .forms import AdminInteractionForm
  [wsgi:error]   File "/home/jamin/www/dev.tir.com/tir/company/forms.py", line 87
  [wsgi:error]     resp = f"Hi {user.first_name}, you'll need to login to send any more suggestions. \\
  [wsgi:error]                              \\n\\nFirst Time? Check your email/spam for login instructions from us."
  [wsgi:error]                                                                                        
  [wsgi:error]                                                                                                   ^
  [wsgi:error] SyntaxError: invalid syntax
  </code></pre>
  
  <p>*also tir.com is shorthand for my actual site - i do not have anything to do with that domain</p>