Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(1, dirname(dirname(abspath(__file__))))

os.environ['DJANGO_SETTINGS_MODULE'] = 'networkapi.settings'
import networkapi.settings
# Skip Django configuration on ReadTheDocs to avoid SECRET_KEY errors
if not os.environ.get('READTHEDOCS'):
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'networkapi.settings')
try:
import networkapi.settings
except Exception:
pass

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -77,9 +82,17 @@
# built documents.
#
# The short X.Y version.
version = networkapi.VERSION
try:
import networkapi
version = networkapi.VERSION
except (ImportError, AttributeError):
version = '3.14.11'
# The full version, including alpha/beta/rc tags.
release = networkapi.VERSION
try:
import networkapi
release = networkapi.VERSION
except (ImportError, AttributeError):
release = '3.14.11'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading