Skip to content

Commit

Permalink
Fixed building docs on modern Django
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Jul 15, 2019
1 parent 59c53f1 commit 97ff992
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To keep using the old icon theme, add ``FLUENT_DASHBOARD_ICON_THEME = 'oxygen'``


Released as 1.0a1 (2016-05-08)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Use new icons from www.flaticon.com

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/_ext/djangodummy/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# for readthedocs
Django==2.2.3
django-admin-tools==0.8.1
dashboardmods==1.0
sphinxcontrib-django==0.4
45 changes: 45 additions & 0 deletions docs/_ext/djangodummy/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Settings file to allow parsing API documentation of Django modules,
# and provide defaults to use in the documentation.
#
# This file is placed in a subfolder,
# so the docs root is not used by find_packages()

STATIC_URL = "/static/"
SECRET_KEY = "docs"

USE_I18N = True

INSTALLED_APPS = [
"fluent_dashboard",
"admin_tools",
"admin_tools.theming",
"admin_tools.menu",
"admin_tools.dashboard",
"django.contrib.admin",
"django.contrib.contenttypes",
]

ADMIN_TOOLS_INDEX_DASHBOARD = "fluent_dashboard.dashboard.FluentIndexDashboard"
ADMIN_TOOLS_APP_INDEX_DASHBOARD = "fluent_dashboard.dashboard.FluentAppIndexDashboard"
ADMIN_TOOLS_MENU = "fluent_dashboard.menu.FluentMenu"

MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.locale.LocaleMiddleware", # / will be redirected to /<locale>/
]

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": (),
"OPTIONS": {
"loaders": (
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
"admin_tools.template_loaders.Loader",
)
},
}
]
15 changes: 12 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@
import os
import sys

import django
import sphinx_rtd_theme

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("_ext"))
sys.path.insert(0, os.path.abspath(".."))
os.environ["DJANGO_SETTINGS_MODULE"] = "djangodummy.settings"

django.setup()

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinxcontrib_django"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down Expand Up @@ -94,7 +99,8 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -265,3 +271,6 @@
"https://docs.djangoproject.com/en/dev": "https://docs.djangoproject.com/en/dev/_objects",
"https://django-admin-tools.readthedocs.io/en/latest/": None,
}

# autodoc settings
autodoc_member_order = "groupwise"
4 changes: 0 additions & 4 deletions docs/djangodummy/requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions docs/djangodummy/settings.py

This file was deleted.

0 comments on commit 97ff992

Please sign in to comment.