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
This commit is contained in:
David Lyle 2015-08-18 10:54:05 -06:00
parent bcc96714b9
commit 49ae7f9eeb
1 changed files with 3 additions and 0 deletions

View File

@ -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():