1. # Django documentation build configuration file, created by
    
  2. # sphinx-quickstart on Thu Mar 27 09:06:53 2008.
    
  3. #
    
  4. # This file is execfile()d with the current directory set to its containing dir.
    
  5. #
    
  6. # The contents of this file are pickled, so don't put values in the namespace
    
  7. # that aren't picklable (module imports are okay, they're removed automatically).
    
  8. #
    
  9. # All configuration values have a default; values that are commented out
    
  10. # serve to show the default.
    
  11. 
    
  12. import sys
    
  13. from os.path import abspath, dirname, join
    
  14. 
    
  15. # Workaround for sphinx-build recursion limit overflow:
    
  16. # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
    
  17. #  RuntimeError: maximum recursion depth exceeded while pickling an object
    
  18. #
    
  19. # Python's default allowed recursion depth is 1000 but this isn't enough for
    
  20. # building docs/ref/settings.txt sometimes.
    
  21. # https://groups.google.com/g/sphinx-dev/c/MtRf64eGtv4/discussion
    
  22. sys.setrecursionlimit(2000)
    
  23. 
    
  24. # Make sure we get the version of this copy of Django
    
  25. sys.path.insert(1, dirname(dirname(abspath(__file__))))
    
  26. 
    
  27. # If extensions (or modules to document with autodoc) are in another directory,
    
  28. # add these directories to sys.path here. If the directory is relative to the
    
  29. # documentation root, use os.path.abspath to make it absolute, like shown here.
    
  30. sys.path.append(abspath(join(dirname(__file__), "_ext")))
    
  31. 
    
  32. # -- General configuration -----------------------------------------------------
    
  33. 
    
  34. # If your documentation needs a minimal Sphinx version, state it here.
    
  35. needs_sphinx = "4.5.0"
    
  36. 
    
  37. # Add any Sphinx extension module names here, as strings. They can be extensions
    
  38. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
    
  39. extensions = [
    
  40.     "djangodocs",
    
  41.     "sphinx.ext.extlinks",
    
  42.     "sphinx.ext.intersphinx",
    
  43.     "sphinx.ext.viewcode",
    
  44.     "sphinx.ext.autosectionlabel",
    
  45. ]
    
  46. 
    
  47. # AutosectionLabel settings.
    
  48. # Uses a <page>:<label> schema which doesn't work for duplicate sub-section
    
  49. # labels, so set max depth.
    
  50. autosectionlabel_prefix_document = True
    
  51. autosectionlabel_maxdepth = 2
    
  52. 
    
  53. # Linkcheck settings.
    
  54. linkcheck_ignore = [
    
  55.     # Special-use addresses and domain names. (RFC 6761/6890)
    
  56.     r"^https?://(?:127\.0\.0\.1|\[::1\])(?::\d+)?/",
    
  57.     r"^https?://(?:[^/\.]+\.)*example\.(?:com|net|org)(?::\d+)?/",
    
  58.     r"^https?://(?:[^/\.]+\.)*(?:example|invalid|localhost|test)(?::\d+)?/",
    
  59.     # Pages that are inaccessible because they require authentication.
    
  60.     r"^https://github\.com/[^/]+/[^/]+/fork",
    
  61.     r"^https://code\.djangoproject\.com/github/login",
    
  62.     r"^https://code\.djangoproject\.com/newticket",
    
  63.     r"^https://(?:code|www)\.djangoproject\.com/admin/",
    
  64.     r"^https://www\.djangoproject\.com/community/add/blogs/",
    
  65.     r"^https://www\.google\.com/webmasters/tools/ping",
    
  66.     r"^https://search\.google\.com/search-console/welcome",
    
  67.     # Fragments used to dynamically switch content or populate fields.
    
  68.     r"^https://web\.libera\.chat/#",
    
  69.     r"^https://github\.com/[^#]+#L\d+-L\d+$",
    
  70.     r"^https://help\.apple\.com/itc/podcasts_connect/#/itc",
    
  71.     # Anchors on certain pages with missing a[name] attributes.
    
  72.     r"^https://tools\.ietf\.org/html/rfc1123\.html#section-",
    
  73. ]
    
  74. 
    
  75. # Spelling check needs an additional module that is not installed by default.
    
  76. # Add it only if spelling check is requested so docs can be generated without it.
    
  77. if "spelling" in sys.argv:
    
  78.     extensions.append("sphinxcontrib.spelling")
    
  79. 
    
  80. # Spelling language.
    
  81. spelling_lang = "en_US"
    
  82. 
    
  83. # Location of word list.
    
  84. spelling_word_list_filename = "spelling_wordlist"
    
  85. 
    
  86. spelling_warning = True
    
  87. 
    
  88. # Add any paths that contain templates here, relative to this directory.
    
  89. # templates_path = []
    
  90. 
    
  91. # The suffix of source filenames.
    
  92. source_suffix = ".txt"
    
  93. 
    
  94. # The encoding of source files.
    
  95. # source_encoding = 'utf-8-sig'
    
  96. 
    
  97. # The root toctree document.
    
  98. root_doc = "contents"
    
  99. 
    
  100. # Disable auto-created table of contents entries for all domain objects (e.g.
    
  101. # functions, classes, attributes, etc.) in Sphinx 5.2+.
    
  102. toc_object_entries = False
    
  103. 
    
  104. # General substitutions.
    
  105. project = "Django"
    
  106. copyright = "Django Software Foundation and contributors"
    
  107. 
    
  108. 
    
  109. # The version info for the project you're documenting, acts as replacement for
    
  110. # |version| and |release|, also used in various other places throughout the
    
  111. # built documents.
    
  112. #
    
  113. # The short X.Y version.
    
  114. version = "4.1"
    
  115. # The full version, including alpha/beta/rc tags.
    
  116. try:
    
  117.     from django import VERSION, get_version
    
  118. except ImportError:
    
  119.     release = version
    
  120. else:
    
  121. 
    
  122.     def django_release():
    
  123.         pep440ver = get_version()
    
  124.         if VERSION[3:5] == ("alpha", 0) and "dev" not in pep440ver:
    
  125.             return pep440ver + ".dev"
    
  126.         return pep440ver
    
  127. 
    
  128.     release = django_release()
    
  129. 
    
  130. # The "development version" of Django
    
  131. django_next_version = "4.2"
    
  132. 
    
  133. extlinks = {
    
  134.     "bpo": ("https://bugs.python.org/issue?@action=redirect&bpo=%s", "bpo-%s"),
    
  135.     "commit": ("https://github.com/django/django/commit/%s", "%s"),
    
  136.     "cve": ("https://nvd.nist.gov/vuln/detail/CVE-%s", "CVE-%s"),
    
  137.     # A file or directory. GitHub redirects from blob to tree if needed.
    
  138.     "source": ("https://github.com/django/django/blob/main/%s", "%s"),
    
  139.     "ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"),
    
  140. }
    
  141. 
    
  142. # The language for content autogenerated by Sphinx. Refer to documentation
    
  143. # for a list of supported languages.
    
  144. # language = None
    
  145. 
    
  146. # Location for .po/.mo translation files used when language is set
    
  147. locale_dirs = ["locale/"]
    
  148. 
    
  149. # There are two options for replacing |today|: either, you set today to some
    
  150. # non-false value, then it is used:
    
  151. # today = ''
    
  152. # Else, today_fmt is used as the format for a strftime call.
    
  153. today_fmt = "%B %d, %Y"
    
  154. 
    
  155. # List of patterns, relative to source directory, that match files and
    
  156. # directories to ignore when looking for source files.
    
  157. exclude_patterns = ["_build", "_theme", "requirements.txt"]
    
  158. 
    
  159. # The reST default role (used for this markup: `text`) to use for all documents.
    
  160. default_role = "default-role-error"
    
  161. 
    
  162. # If true, '()' will be appended to :func: etc. cross-reference text.
    
  163. add_function_parentheses = True
    
  164. 
    
  165. # If true, the current module name will be prepended to all description
    
  166. # unit titles (such as .. function::).
    
  167. add_module_names = False
    
  168. 
    
  169. # If true, sectionauthor and moduleauthor directives will be shown in the
    
  170. # output. They are ignored by default.
    
  171. show_authors = False
    
  172. 
    
  173. # The name of the Pygments (syntax highlighting) style to use.
    
  174. pygments_style = "trac"
    
  175. 
    
  176. # Links to Python's docs should reference the most recent version of the 3.x
    
  177. # branch, which is located at this URL.
    
  178. intersphinx_mapping = {
    
  179.     "python": ("https://docs.python.org/3/", None),
    
  180.     "sphinx": ("https://www.sphinx-doc.org/en/master/", None),
    
  181.     "psycopg2": ("https://www.psycopg.org/docs/", None),
    
  182. }
    
  183. 
    
  184. # Python's docs don't change every week.
    
  185. intersphinx_cache_limit = 90  # days
    
  186. 
    
  187. # The 'versionadded' and 'versionchanged' directives are overridden.
    
  188. suppress_warnings = ["app.add_directive"]
    
  189. 
    
  190. # -- Options for HTML output ---------------------------------------------------
    
  191. 
    
  192. # The theme to use for HTML and HTML Help pages.  See the documentation for
    
  193. # a list of builtin themes.
    
  194. html_theme = "djangodocs"
    
  195. 
    
  196. # Theme options are theme-specific and customize the look and feel of a theme
    
  197. # further.  For a list of options available for each theme, see the
    
  198. # documentation.
    
  199. # html_theme_options = {}
    
  200. 
    
  201. # Add any paths that contain custom themes here, relative to this directory.
    
  202. html_theme_path = ["_theme"]
    
  203. 
    
  204. # The name for this set of Sphinx documents.  If None, it defaults to
    
  205. # "<project> v<release> documentation".
    
  206. # html_title = None
    
  207. 
    
  208. # A shorter title for the navigation bar.  Default is the same as html_title.
    
  209. # html_short_title = None
    
  210. 
    
  211. # The name of an image file (relative to this directory) to place at the top
    
  212. # of the sidebar.
    
  213. # html_logo = None
    
  214. 
    
  215. # The name of an image file (within the static path) to use as favicon of the
    
  216. # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
    
  217. # pixels large.
    
  218. # html_favicon = None
    
  219. 
    
  220. # Add any paths that contain custom static files (such as style sheets) here,
    
  221. # relative to this directory. They are copied after the builtin static files,
    
  222. # so a file named "default.css" will overwrite the builtin "default.css".
    
  223. # html_static_path = ["_static"]
    
  224. 
    
  225. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
    
  226. # using the given strftime format.
    
  227. html_last_updated_fmt = "%b %d, %Y"
    
  228. 
    
  229. # Content template for the index page.
    
  230. # html_index = ''
    
  231. 
    
  232. # Custom sidebar templates, maps document names to template names.
    
  233. # html_sidebars = {}
    
  234. 
    
  235. # Additional templates that should be rendered to pages, maps page names to
    
  236. # template names.
    
  237. html_additional_pages = {}
    
  238. 
    
  239. # If false, no module index is generated.
    
  240. # html_domain_indices = True
    
  241. 
    
  242. # If false, no index is generated.
    
  243. # html_use_index = True
    
  244. 
    
  245. # If true, the index is split into individual pages for each letter.
    
  246. # html_split_index = False
    
  247. 
    
  248. # If true, links to the reST sources are added to the pages.
    
  249. # html_show_sourcelink = True
    
  250. 
    
  251. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
    
  252. # html_show_sphinx = True
    
  253. 
    
  254. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
    
  255. # html_show_copyright = True
    
  256. 
    
  257. # If true, an OpenSearch description file will be output, and all pages will
    
  258. # contain a <link> tag referring to it.  The value of this option must be the
    
  259. # base URL from which the finished HTML is served.
    
  260. # html_use_opensearch = ''
    
  261. 
    
  262. # This is the file name suffix for HTML files (e.g. ".xhtml").
    
  263. # html_file_suffix = None
    
  264. 
    
  265. # Output file base name for HTML help builder.
    
  266. htmlhelp_basename = "Djangodoc"
    
  267. 
    
  268. modindex_common_prefix = ["django."]
    
  269. 
    
  270. # Appended to every page
    
  271. rst_epilog = """
    
  272. .. |django-users| replace:: :ref:`django-users <django-users-mailing-list>`
    
  273. .. |django-developers| replace:: :ref:`django-developers <django-developers-mailing-list>`
    
  274. .. |django-announce| replace:: :ref:`django-announce <django-announce-mailing-list>`
    
  275. .. |django-updates| replace:: :ref:`django-updates <django-updates-mailing-list>`
    
  276. """  # NOQA
    
  277. 
    
  278. # -- Options for LaTeX output --------------------------------------------------
    
  279. 
    
  280. # Use XeLaTeX for Unicode support.
    
  281. latex_engine = "xelatex"
    
  282. latex_use_xindy = False
    
  283. # Set font for CJK and fallbacks for unicode characters.
    
  284. latex_elements = {
    
  285.     "fontpkg": r"""
    
  286.         \setmainfont{Symbola}
    
  287.     """,
    
  288.     "preamble": r"""
    
  289.         \usepackage{newunicodechar}
    
  290.         \usepackage[UTF8]{ctex}
    
  291.         \newunicodechar{π}{\ensuremath{\pi}}
    
  292.         \newunicodechar{≤}{\ensuremath{\le}}
    
  293.         \newunicodechar{≥}{\ensuremath{\ge}}
    
  294.         \newunicodechar{♥}{\ensuremath{\heartsuit}}
    
  295.         \newunicodechar{…}{\ensuremath{\ldots}}
    
  296.     """,
    
  297. }
    
  298. 
    
  299. # Grouping the document tree into LaTeX files. List of tuples
    
  300. # (source start file, target name, title, author, document class [howto/manual]).
    
  301. # latex_documents = []
    
  302. latex_documents = [
    
  303.     (
    
  304.         "contents",
    
  305.         "django.tex",
    
  306.         "Django Documentation",
    
  307.         "Django Software Foundation",
    
  308.         "manual",
    
  309.     ),
    
  310. ]
    
  311. 
    
  312. # The name of an image file (relative to this directory) to place at the top of
    
  313. # the title page.
    
  314. # latex_logo = None
    
  315. 
    
  316. # For "manual" documents, if this is true, then toplevel headings are parts,
    
  317. # not chapters.
    
  318. # latex_use_parts = False
    
  319. 
    
  320. # If true, show page references after internal links.
    
  321. # latex_show_pagerefs = False
    
  322. 
    
  323. # If true, show URL addresses after external links.
    
  324. # latex_show_urls = False
    
  325. 
    
  326. # Documents to append as an appendix to all manuals.
    
  327. # latex_appendices = []
    
  328. 
    
  329. # If false, no module index is generated.
    
  330. # latex_domain_indices = True
    
  331. 
    
  332. 
    
  333. # -- Options for manual page output --------------------------------------------
    
  334. 
    
  335. # One entry per manual page. List of tuples
    
  336. # (source start file, name, description, authors, manual section).
    
  337. man_pages = [
    
  338.     (
    
  339.         "ref/django-admin",
    
  340.         "django-admin",
    
  341.         "Utility script for the Django web framework",
    
  342.         ["Django Software Foundation"],
    
  343.         1,
    
  344.     )
    
  345. ]
    
  346. 
    
  347. 
    
  348. # -- Options for Texinfo output ------------------------------------------------
    
  349. 
    
  350. # List of tuples (startdocname, targetname, title, author, dir_entry,
    
  351. # description, category, toctree_only)
    
  352. texinfo_documents = [
    
  353.     (
    
  354.         root_doc,
    
  355.         "django",
    
  356.         "",
    
  357.         "",
    
  358.         "Django",
    
  359.         "Documentation of the Django framework",
    
  360.         "Web development",
    
  361.         False,
    
  362.     )
    
  363. ]
    
  364. 
    
  365. 
    
  366. # -- Options for Epub output ---------------------------------------------------
    
  367. 
    
  368. # Bibliographic Dublin Core info.
    
  369. epub_title = project
    
  370. epub_author = "Django Software Foundation"
    
  371. epub_publisher = "Django Software Foundation"
    
  372. epub_copyright = copyright
    
  373. 
    
  374. # The basename for the epub file. It defaults to the project name.
    
  375. # epub_basename = 'Django'
    
  376. 
    
  377. # The HTML theme for the epub output. Since the default themes are not optimized
    
  378. # for small screen space, using the same theme for HTML and epub output is
    
  379. # usually not wise. This defaults to 'epub', a theme designed to save visual
    
  380. # space.
    
  381. epub_theme = "djangodocs-epub"
    
  382. 
    
  383. # The language of the text. It defaults to the language option
    
  384. # or en if the language is not set.
    
  385. # epub_language = ''
    
  386. 
    
  387. # The scheme of the identifier. Typical schemes are ISBN or URL.
    
  388. # epub_scheme = ''
    
  389. 
    
  390. # The unique identifier of the text. This can be an ISBN number
    
  391. # or the project homepage.
    
  392. # epub_identifier = ''
    
  393. 
    
  394. # A unique identification for the text.
    
  395. # epub_uid = ''
    
  396. 
    
  397. # A tuple containing the cover image and cover page html template filenames.
    
  398. epub_cover = ("", "epub-cover.html")
    
  399. 
    
  400. # A sequence of (type, uri, title) tuples for the guide element of content.opf.
    
  401. # epub_guide = ()
    
  402. 
    
  403. # HTML files that should be inserted before the pages created by sphinx.
    
  404. # The format is a list of tuples containing the path and title.
    
  405. # epub_pre_files = []
    
  406. 
    
  407. # HTML files shat should be inserted after the pages created by sphinx.
    
  408. # The format is a list of tuples containing the path and title.
    
  409. # epub_post_files = []
    
  410. 
    
  411. # A list of files that should not be packed into the epub file.
    
  412. # epub_exclude_files = []
    
  413. 
    
  414. # The depth of the table of contents in toc.ncx.
    
  415. # epub_tocdepth = 3
    
  416. 
    
  417. # Allow duplicate toc entries.
    
  418. # epub_tocdup = True
    
  419. 
    
  420. # Choose between 'default' and 'includehidden'.
    
  421. # epub_tocscope = 'default'
    
  422. 
    
  423. # Fix unsupported image types using the PIL.
    
  424. # epub_fix_images = False
    
  425. 
    
  426. # Scale large images.
    
  427. # epub_max_image_width = 0
    
  428. 
    
  429. # How to display URL addresses: 'footnote', 'no', or 'inline'.
    
  430. # epub_show_urls = 'inline'
    
  431. 
    
  432. # If false, no index is generated.
    
  433. # epub_use_index = True