openstack-ansible-os_horizon/templates/horizon_django.wsgi.j2
Jesse Pretorius 53e79276c9 Rename SUSE vars file and remove mysql-python
The SUSE builds are failing due to a change in the galera_client
role causing the trove role's vars file to be found before the
galera_client vars file. We therefore rename the trove vars file
for SUSE. This also makes transitions between versions easier.

The mysql-python package is no longer maintained. We are using
pymysql instead, so this package does not need to be installed.
This resolves current build failures due to the mysql-python
package not being installable due to the new version of MariaDB
being used.

With this, we also switch django to use pymysql and ensure that
the appropriate distribution package is installed when doing
distro builds.

Depends-On: https://review.openstack.org/602924
Change-Id: I020678e0beb131836e3006e46eec22c02977f8ec
2018-09-15 20:53:09 -06:00

18 lines
478 B
Django/Jinja

import logging
import os
import pymysql
import sys
from django.core.wsgi import get_wsgi_application
from django.conf import settings
pymysql.install_as_MySQLdb()
# Add this file path to sys.path in order to import settings
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..')))
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
sys.stdout = sys.stderr
DEBUG = False
application = get_wsgi_application()