mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
doc/dev: Fix Django related errors with auto-documentation
Closes: #2405. - When Django module is mocked, there are some cases where modules using django can't be imported due to errors. - To fix that, don't mock the django module and require django and related Debian packages to be installed on the system generate developer documentation. - Initialize django in Sphinx configuration to allow django modules to be imported without errors. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
3b5abf1ae9
commit
70742bfd91
@ -19,6 +19,11 @@ Install the following Debian packages:
|
||||
|
||||
* python3-sphinx
|
||||
* python3-sphinx-autobuild
|
||||
* python3-django
|
||||
* python3-django-axes
|
||||
* python3-django-captcha
|
||||
* python3-django-ipware
|
||||
* python3-django-stronghold
|
||||
|
||||
If your preferred text editor doesn't have support for the reStructuredText
|
||||
format, you can install a simple desktop application called ReText. It has live
|
||||
|
||||
@ -16,7 +16,11 @@ list see the documentation: http://www.sphinx-doc.org/en/master/config
|
||||
import os
|
||||
import sys
|
||||
|
||||
import django
|
||||
|
||||
sys.path.insert(0, os.path.abspath('../../'))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'plinth.settings'
|
||||
django.setup()
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
@ -203,7 +207,6 @@ autodoc_mock_imports = [
|
||||
'cherrypy',
|
||||
'configobj',
|
||||
'dbus',
|
||||
'django',
|
||||
'gi',
|
||||
'markupsafe',
|
||||
'OpenSSL',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user