Call `django.setup()` before making docs

Django 1.9 requires this line before importing any models. Autodoc
imported models to get their docstrings, causing errors in the build
process.

Fixes #2014.
pull/1990/merge
Tim Heap 2015-12-09 10:40:27 +11:00 zatwierdzone przez Matt Westcott
rodzic abe4eb6f28
commit 8ddd9ee537
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -35,6 +35,8 @@ from wagtail.wagtailcore import __version__
# Autodoc may need to import some models modules which require django settings
# be configured
os.environ['DJANGO_SETTINGS_MODULE'] = 'wagtail.tests.settings'
import django
django.setup()
# Use SQLite3 database engine so it doesn't attempt to use psycopg2 on RTD
os.environ['DATABASE_ENGINE'] = 'django.db.backends.sqlite3'