mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Fix for django-jsonfield to work on Django 1.4.1 (default with Ubuntu 12.10, fix for AC-222), update settings to provide more information when unable to load local/global settings file.
This commit is contained in:
22
awx/wsgi.py
22
awx/wsgi.py
@@ -10,25 +10,9 @@ For more information on this file, see
|
||||
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
from awx import MODE
|
||||
from distutils.sysconfig import get_python_lib
|
||||
|
||||
# Update the default settings environment variable based on current mode.
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'awx.settings.%s' % MODE)
|
||||
|
||||
# Add local site-packages directory to path.
|
||||
local_site_packages = os.path.join(os.path.dirname(__file__), 'lib',
|
||||
'site-packages')
|
||||
sys.path.insert(0, local_site_packages)
|
||||
|
||||
# Hide DeprecationWarnings when running in production. Need to first load
|
||||
# settings to apply our filter after Django's own warnings filter.
|
||||
from django.conf import settings
|
||||
if not settings.DEBUG:
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
# Prepare the AWX environment.
|
||||
from awx import prepare_env
|
||||
prepare_env()
|
||||
|
||||
# Return the default Django WSGI application.
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
Reference in New Issue
Block a user