Page MenuHomeSoftware Heritage

sphin/ Improve django settings handling

Authored by anlambert on Apr 20 2021, 5:59 PM.



Software Heritage uses Django in several packages: swh-auth, swh-deposit
and swh-web.

When building global or local package documentation, the environment
variable DJANGO_SETTINGS_MODULE must be set to the adequate settings
module in order to avoid errors with sphinx autodoc processing.

Previous approach was merging swh-deposit and swh-web django settings
but it did not prevent all autodoc errors due to some missing or
unexpected django setting value.

New approach force reset Django settings according to the next rst
document to read by sphinx. This ensures adequate django settings
will be set for each swh packages before processing apidoc generated
rst files.

It also enables to not depend on swh-deposit and swh-web for building
a local package documentation.

Depends on D5565

Related to T3258

Diff Detail

rDDOC Development documentation
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This revision is now accepted and ready to land.Apr 20 2021, 6:27 PM