conf.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. import sys
  12. from os.path import abspath, dirname, join
  13. # Workaround for sphinx-build recursion limit overflow:
  14. # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
  15. # RuntimeError: maximum recursion depth exceeded while pickling an object
  16. #
  17. # Python's default allowed recursion depth is 1000 but this isn't enough for
  18. # building docs/ref/settings.txt sometimes.
  19. # https://groups.google.com/d/topic/sphinx-dev/MtRf64eGtv4/discussion
  20. sys.setrecursionlimit(2000)
  21. # Make sure we get the version of this copy of Django
  22. sys.path.insert(1, dirname(dirname(abspath(__file__))))
  23. # If extensions (or modules to document with autodoc) are in another directory,
  24. # add these directories to sys.path here. If the directory is relative to the
  25. # documentation root, use os.path.abspath to make it absolute, like shown here.
  26. sys.path.append(abspath(join(dirname(__file__), "_ext")))
  27. # -- General configuration -----------------------------------------------------
  28. # If your documentation needs a minimal Sphinx version, state it here.
  29. needs_sphinx = '1.6.0'
  30. # Add any Sphinx extension module names here, as strings. They can be extensions
  31. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  32. extensions = [
  33. "djangodocs",
  34. 'sphinx.ext.extlinks',
  35. "sphinx.ext.intersphinx",
  36. "sphinx.ext.viewcode",
  37. "sphinx.ext.autosectionlabel",
  38. ]
  39. # AutosectionLabel settings.
  40. # Uses a <page>:<label> schema which doesn't work for duplicate sub-section
  41. # labels, so set max depth.
  42. autosectionlabel_prefix_document = True
  43. autosectionlabel_maxdepth = 2
  44. # Spelling check needs an additional module that is not installed by default.
  45. # Add it only if spelling check is requested so docs can be generated without it.
  46. if 'spelling' in sys.argv:
  47. extensions.append("sphinxcontrib.spelling")
  48. # Spelling language.
  49. spelling_lang = 'en_US'
  50. # Location of word list.
  51. spelling_word_list_filename = 'spelling_wordlist'
  52. spelling_warning = True
  53. # Add any paths that contain templates here, relative to this directory.
  54. # templates_path = []
  55. # The suffix of source filenames.
  56. source_suffix = '.txt'
  57. # The encoding of source files.
  58. # source_encoding = 'utf-8-sig'
  59. # The master toctree document.
  60. master_doc = 'contents'
  61. # General substitutions.
  62. project = 'Django'
  63. copyright = 'Django Software Foundation and contributors'
  64. # The version info for the project you're documenting, acts as replacement for
  65. # |version| and |release|, also used in various other places throughout the
  66. # built documents.
  67. #
  68. # The short X.Y version.
  69. version = '4.0'
  70. # The full version, including alpha/beta/rc tags.
  71. try:
  72. from django import VERSION, get_version
  73. except ImportError:
  74. release = version
  75. else:
  76. def django_release():
  77. pep440ver = get_version()
  78. if VERSION[3:5] == ('alpha', 0) and 'dev' not in pep440ver:
  79. return pep440ver + '.dev'
  80. return pep440ver
  81. release = django_release()
  82. # The "development version" of Django
  83. django_next_version = '4.0'
  84. extlinks = {
  85. 'bpo': ('https://bugs.python.org/issue%s', 'bpo-'),
  86. 'commit': ('https://github.com/django/django/commit/%s', ''),
  87. 'cve': ('https://nvd.nist.gov/vuln/detail/CVE-%s', 'CVE-'),
  88. # A file or directory. GitHub redirects from blob to tree if needed.
  89. 'source': ('https://github.com/django/django/blob/main/%s', ''),
  90. 'ticket': ('https://code.djangoproject.com/ticket/%s', '#'),
  91. }
  92. # The language for content autogenerated by Sphinx. Refer to documentation
  93. # for a list of supported languages.
  94. # language = None
  95. # Location for .po/.mo translation files used when language is set
  96. locale_dirs = ['locale/']
  97. # There are two options for replacing |today|: either, you set today to some
  98. # non-false value, then it is used:
  99. # today = ''
  100. # Else, today_fmt is used as the format for a strftime call.
  101. today_fmt = '%B %d, %Y'
  102. # List of patterns, relative to source directory, that match files and
  103. # directories to ignore when looking for source files.
  104. exclude_patterns = ['_build', '_theme', 'requirements.txt']
  105. # The reST default role (used for this markup: `text`) to use for all documents.
  106. default_role = "default-role-error"
  107. # If true, '()' will be appended to :func: etc. cross-reference text.
  108. add_function_parentheses = True
  109. # If true, the current module name will be prepended to all description
  110. # unit titles (such as .. function::).
  111. add_module_names = False
  112. # If true, sectionauthor and moduleauthor directives will be shown in the
  113. # output. They are ignored by default.
  114. show_authors = False
  115. # The name of the Pygments (syntax highlighting) style to use.
  116. pygments_style = 'trac'
  117. # Links to Python's docs should reference the most recent version of the 3.x
  118. # branch, which is located at this URL.
  119. intersphinx_mapping = {
  120. 'python': ('https://docs.python.org/3/', None),
  121. 'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
  122. 'psycopg2': ('https://www.psycopg.org/docs/', None),
  123. }
  124. # Python's docs don't change every week.
  125. intersphinx_cache_limit = 90 # days
  126. # The 'versionadded' and 'versionchanged' directives are overridden.
  127. suppress_warnings = ['app.add_directive']
  128. # -- Options for HTML output ---------------------------------------------------
  129. # The theme to use for HTML and HTML Help pages. See the documentation for
  130. # a list of builtin themes.
  131. html_theme = "djangodocs"
  132. # Theme options are theme-specific and customize the look and feel of a theme
  133. # further. For a list of options available for each theme, see the
  134. # documentation.
  135. # html_theme_options = {}
  136. # Add any paths that contain custom themes here, relative to this directory.
  137. html_theme_path = ["_theme"]
  138. # The name for this set of Sphinx documents. If None, it defaults to
  139. # "<project> v<release> documentation".
  140. # html_title = None
  141. # A shorter title for the navigation bar. Default is the same as html_title.
  142. # html_short_title = None
  143. # The name of an image file (relative to this directory) to place at the top
  144. # of the sidebar.
  145. # html_logo = None
  146. # The name of an image file (within the static path) to use as favicon of the
  147. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  148. # pixels large.
  149. # html_favicon = None
  150. # Add any paths that contain custom static files (such as style sheets) here,
  151. # relative to this directory. They are copied after the builtin static files,
  152. # so a file named "default.css" will overwrite the builtin "default.css".
  153. # html_static_path = ["_static"]
  154. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  155. # using the given strftime format.
  156. html_last_updated_fmt = '%b %d, %Y'
  157. # Content template for the index page.
  158. # html_index = ''
  159. # Custom sidebar templates, maps document names to template names.
  160. # html_sidebars = {}
  161. # Additional templates that should be rendered to pages, maps page names to
  162. # template names.
  163. html_additional_pages = {}
  164. # If false, no module index is generated.
  165. # html_domain_indices = True
  166. # If false, no index is generated.
  167. # html_use_index = True
  168. # If true, the index is split into individual pages for each letter.
  169. # html_split_index = False
  170. # If true, links to the reST sources are added to the pages.
  171. # html_show_sourcelink = True
  172. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  173. # html_show_sphinx = True
  174. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  175. # html_show_copyright = True
  176. # If true, an OpenSearch description file will be output, and all pages will
  177. # contain a <link> tag referring to it. The value of this option must be the
  178. # base URL from which the finished HTML is served.
  179. # html_use_opensearch = ''
  180. # This is the file name suffix for HTML files (e.g. ".xhtml").
  181. # html_file_suffix = None
  182. # Output file base name for HTML help builder.
  183. htmlhelp_basename = 'Djangodoc'
  184. modindex_common_prefix = ["django."]
  185. # Appended to every page
  186. rst_epilog = """
  187. .. |django-users| replace:: :ref:`django-users <django-users-mailing-list>`
  188. .. |django-core-mentorship| replace:: :ref:`django-core-mentorship <django-core-mentorship-mailing-list>`
  189. .. |django-developers| replace:: :ref:`django-developers <django-developers-mailing-list>`
  190. .. |django-announce| replace:: :ref:`django-announce <django-announce-mailing-list>`
  191. .. |django-updates| replace:: :ref:`django-updates <django-updates-mailing-list>`
  192. """
  193. # -- Options for LaTeX output --------------------------------------------------
  194. latex_elements = {
  195. 'preamble': (
  196. '\\DeclareUnicodeCharacter{2264}{\\ensuremath{\\le}}'
  197. '\\DeclareUnicodeCharacter{2265}{\\ensuremath{\\ge}}'
  198. '\\DeclareUnicodeCharacter{2665}{[unicode-heart]}'
  199. '\\DeclareUnicodeCharacter{2713}{[unicode-checkmark]}'
  200. ),
  201. }
  202. # Grouping the document tree into LaTeX files. List of tuples
  203. # (source start file, target name, title, author, document class [howto/manual]).
  204. # latex_documents = []
  205. latex_documents = [
  206. ('contents', 'django.tex', 'Django Documentation',
  207. 'Django Software Foundation', 'manual'),
  208. ]
  209. # The name of an image file (relative to this directory) to place at the top of
  210. # the title page.
  211. # latex_logo = None
  212. # For "manual" documents, if this is true, then toplevel headings are parts,
  213. # not chapters.
  214. # latex_use_parts = False
  215. # If true, show page references after internal links.
  216. # latex_show_pagerefs = False
  217. # If true, show URL addresses after external links.
  218. # latex_show_urls = False
  219. # Documents to append as an appendix to all manuals.
  220. # latex_appendices = []
  221. # If false, no module index is generated.
  222. # latex_domain_indices = True
  223. # -- Options for manual page output --------------------------------------------
  224. # One entry per manual page. List of tuples
  225. # (source start file, name, description, authors, manual section).
  226. man_pages = [(
  227. 'ref/django-admin',
  228. 'django-admin',
  229. 'Utility script for the Django Web framework',
  230. ['Django Software Foundation'],
  231. 1
  232. )]
  233. # -- Options for Texinfo output ------------------------------------------------
  234. # List of tuples (startdocname, targetname, title, author, dir_entry,
  235. # description, category, toctree_only)
  236. texinfo_documents = [(
  237. master_doc, "django", "", "", "Django",
  238. "Documentation of the Django framework", "Web development", False
  239. )]
  240. # -- Options for Epub output ---------------------------------------------------
  241. # Bibliographic Dublin Core info.
  242. epub_title = project
  243. epub_author = 'Django Software Foundation'
  244. epub_publisher = 'Django Software Foundation'
  245. epub_copyright = copyright
  246. # The basename for the epub file. It defaults to the project name.
  247. # epub_basename = 'Django'
  248. # The HTML theme for the epub output. Since the default themes are not optimized
  249. # for small screen space, using the same theme for HTML and epub output is
  250. # usually not wise. This defaults to 'epub', a theme designed to save visual
  251. # space.
  252. epub_theme = 'djangodocs-epub'
  253. # The language of the text. It defaults to the language option
  254. # or en if the language is not set.
  255. # epub_language = ''
  256. # The scheme of the identifier. Typical schemes are ISBN or URL.
  257. # epub_scheme = ''
  258. # The unique identifier of the text. This can be an ISBN number
  259. # or the project homepage.
  260. # epub_identifier = ''
  261. # A unique identification for the text.
  262. # epub_uid = ''
  263. # A tuple containing the cover image and cover page html template filenames.
  264. epub_cover = ('', 'epub-cover.html')
  265. # A sequence of (type, uri, title) tuples for the guide element of content.opf.
  266. # epub_guide = ()
  267. # HTML files that should be inserted before the pages created by sphinx.
  268. # The format is a list of tuples containing the path and title.
  269. # epub_pre_files = []
  270. # HTML files shat should be inserted after the pages created by sphinx.
  271. # The format is a list of tuples containing the path and title.
  272. # epub_post_files = []
  273. # A list of files that should not be packed into the epub file.
  274. # epub_exclude_files = []
  275. # The depth of the table of contents in toc.ncx.
  276. # epub_tocdepth = 3
  277. # Allow duplicate toc entries.
  278. # epub_tocdup = True
  279. # Choose between 'default' and 'includehidden'.
  280. # epub_tocscope = 'default'
  281. # Fix unsupported image types using the PIL.
  282. # epub_fix_images = False
  283. # Scale large images.
  284. # epub_max_image_width = 0
  285. # How to display URL addresses: 'footnote', 'no', or 'inline'.
  286. # epub_show_urls = 'inline'
  287. # If false, no index is generated.
  288. # epub_use_index = True