mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Fix lingering import statement, add context processor to expose settings to templates.
This commit is contained in:
parent
fdc9422409
commit
e6377a1243
@ -30,7 +30,6 @@ from jsonfield import JSONField
|
||||
from djcelery.models import TaskMeta
|
||||
from rest_framework.authtoken.models import Token
|
||||
import yaml
|
||||
from lib.main.fields import *
|
||||
|
||||
# TODO: reporting model TBD
|
||||
|
||||
|
@ -118,6 +118,7 @@ ALLOWED_HOSTS = []
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS += (
|
||||
'django.core.context_processors.request',
|
||||
'lib.ui.context_processors.settings',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES += (
|
||||
|
6
lib/ui/context_processors.py
Normal file
6
lib/ui/context_processors.py
Normal file
@ -0,0 +1,6 @@
|
||||
from django.conf import settings as django_settings
|
||||
|
||||
def settings(request):
|
||||
return {
|
||||
'settings': django_settings,
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
<script src="{{ STATIC_URL }}lib/angular/angular.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/angular/angular-resource.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/angular/angular-cookies.js"></script>
|
||||
{% if not debug %}
|
||||
{% if not settings.DEBUG %}
|
||||
<script src="{{ STATIC_URL }}js/ansible.min.js"></script> <!-- FIXME: Change to whatever we end up calling the minified file. -->
|
||||
{% else %}
|
||||
<script src="{{ STATIC_URL }}js/app.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user