Browse Source

Fix doc build

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

setenv DJANGO_SETTINGS_MODULE for docs env in tox.ini
is no longer needed as it is configured in doc/source/conf.py.

Change-Id: I910dae37770ab9767689918a0c61b78d9c56115a
Akihiro Motoki 1 year ago
parent
commit
b0a2a39508
2 changed files with 4 additions and 1 deletions
  1. 4
    0
      doc/source/conf.py
  2. 0
    1
      tox.ini

+ 4
- 0
doc/source/conf.py View File

@@ -13,8 +13,12 @@
13 13
 
14 14
 import os
15 15
 
16
+import django
17
+
16 18
 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openstack_auth.tests.settings')
17 19
 
20
+django.setup()
21
+
18 22
 # If extensions (or modules to document with autodoc) are in another directory,
19 23
 # add these directories to sys.path here. If the directory is relative to the
20 24
 # documentation root, use os.path.abspath to make it absolute, like shown here.

+ 0
- 1
tox.ini View File

@@ -53,7 +53,6 @@ commands = {posargs}
53 53
 
54 54
 [testenv:docs]
55 55
 setenv = {[env-common]setenv}
56
-         DJANGO_SETTINGS_MODULE=openstack_auth.tests.settings
57 56
 commands = python setup.py build_sphinx
58 57
 
59 58
 [flake8]

Loading…
Cancel
Save