Skip to content

Commit 3ea3e03

Browse files
author
Juliana Cardozo
committed
fix docs conf.py
1 parent 4f91e77 commit 3ea3e03

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

docs/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@
4040
# documentation root, use os.path.abspath to make it absolute, like shown here.
4141
sys.path.insert(1, dirname(dirname(abspath(__file__))))
4242

43-
os.environ['DJANGO_SETTINGS_MODULE'] = 'networkapi.settings'
44-
import networkapi.settings
43+
# Skip Django configuration on ReadTheDocs to avoid SECRET_KEY errors
44+
if not os.environ.get('READTHEDOCS'):
45+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'networkapi.settings')
46+
try:
47+
import networkapi.settings
48+
except Exception:
49+
pass
4550

4651
# -- General configuration ------------------------------------------------
4752

0 commit comments

Comments
 (0)