# If you received the same error as i did:
# AttributeError: 'Values' object has no attribute 'link_base'
# Change your `def create_reference_role(rolename, urlbase):` to this:
def create_reference_role(rolename, urlbase):
# Views and template names are case-sensitive.
is_case_sensitive = rolename in ["template", "view"]
def _role(name, rawtext, text, lineno, inliner, options=None, content=None):
if options is None:
options = {}
try:
node = docutils.nodes.reference(
rawtext,
text,
refuri=(
urlbase
% (
inliner.document.settings.link_base,
text if is_case_sensitive else text.lower(),
)
),
**options,
)
except AttributeError:
node = docutils.nodes.reference(
rawtext,
text,
refuri=None,
**options,
)
return [node], []
docutils.parsers.rst.roles.register_canonical_role(rolename, _role)
# Keep in mind it is a workaround in order to owercome this issue and go on with the document generation.