From 49ae7f9eeb2b84c89a185f4c3595bd7e706c5b84 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Tue, 18 Aug 2015 10:54:05 -0600 Subject: [PATCH] Fix docs translation import errors When building docs, there are a ton of errors in this format: AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time. Starting in Django 1.7, standalone scripts, such as a sphinx build require that django.setup() be called first. See: https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts This should be added to the horizon/docs/source/conf.py Doing so eliminates the errors. Closes-Bug: #1486139 Change-Id: I0871be3d60d4d78cb430fabdb5725832559191d7 --- doc/source/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index b9309c52d3..ebb5c7f933 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -24,6 +24,7 @@ from __future__ import print_function +import django import os import sys @@ -37,6 +38,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openstack_dashboard.settings') import horizon.version +django.setup() + def write_autodoc_index():