misc: force loading of versions cache if {{statics_hash}} is used (#14621)

This commit is contained in:
Frédéric Péters 2017-01-16 13:54:46 +01:00
parent 8f412c5373
commit 57cf20cb2c
2 changed files with 10 additions and 0 deletions

View File

@ -10,5 +10,12 @@ https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "combo.settings")
from django.conf import settings
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
if 'hobo.context_processors.statics_hash' in settings.TEMPLATE_CONTEXT_PROCESSORS:
# initialize versions as soon as possible as it may be used in most
# requests via the statics_hash template var and we prefer not to
# load the information during a user request.
from hobo.scrutiny.wsgi.middleware import VersionMiddleware
VersionMiddleware.get_packages_version()

View File

@ -15,6 +15,9 @@ execfile('/usr/lib/hobo/debian_config_common.py')
# add custom hobo agent module
INSTALLED_APPS = ('hobo.agent.combo', ) + INSTALLED_APPS
# add statics_hash context processor
TEMPLATE_CONTEXT_PROCESSORS.append('hobo.context_processors.statics_hash')
#
# local settings
#