OK, I've found the solution. Here are some guidelines: https://code.djangoproject.com/ticket/6681 For Sphinx: Edit file: sphinx/environment.py Add lines: 26 import docutils 755 docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'title- reference'
And works! On 5 Sty, 09:20, Dreamwalker <r...@rjdg.net> wrote: > Hello, > I'm having a problem with sphinx in Django. I've managed to configure > sphinx to autodoc django modules, but now as I try to `make html` I > get this traceback: > > # Sphinx version: 1.1.2 > # Python version: 2.7.2 > # Docutils version: 0.8.1 release > # Jinja2 version: 2.6 > Traceback (most recent call last): > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > cmdline.py", line 189, in main > app.build(force_all, filenames) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > application.py", line 204, in build > self.builder.build_update() > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > builders/__init__.py", line 196, in build_update > 'out of date' % len(to_build)) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > builders/__init__.py", line 216, in build > purple, length): > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > builders/__init__.py", line 120, in status_iterator > for item in iterable: > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > environment.py", line 613, in update_generator > self.read_doc(docname, app=app) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > environment.py", line 761, in read_doc > pub.publish() > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > core.py", line 211, in publish > self.settings) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > readers/__init__.py", line 69, in read > self.parse() > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > readers/__init__.py", line 75, in parse > self.parser.parse(self.input, document) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/__init__.py", line 157, in parse > self.statemachine.run(inputlines, document, inliner=self.inliner) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 170, in run > input_source=document['source']) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2943, in text > self.section(title.lstrip(), source, style, lineno + 1, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 329, in section > self.new_subsection(title, lineno, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 398, in new_subsection > node=section_node, match_titles=1) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 284, in nested_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2709, in underline > self.section(title, source, style, lineno - 1, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 329, in section > self.new_subsection(title, lineno, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 398, in new_subsection > node=section_node, match_titles=1) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 284, in nested_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2709, in underline > self.section(title, source, style, lineno - 1, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 329, in section > self.new_subsection(title, lineno, messages) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 398, in new_subsection > node=section_node, match_titles=1) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 284, in nested_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2283, in explicit_markup > nodelist, blank_finish = self.explicit_construct(match) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2295, in explicit_construct > return method(self, expmatch) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2036, in directive > directive_class, match, type_name, option_presets) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2087, in run_directive > result = directive_instance.run() > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ext/ > autodoc.py", line 1318, in run > nested_parse_with_titles(self.state, self.result, node) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/util/ > nodes.py", line 74, in nested_parse_with_titles > return state.nested_parse(content, 0, node, match_titles=1) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 284, in nested_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2285, in explicit_markup > self.explicit_list(blank_finish) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2316, in explicit_list > match_titles=self.state_machine.match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 321, in nested_list_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2589, in explicit_markup > nodelist, blank_finish = self.explicit_construct(match) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2295, in explicit_construct > return method(self, expmatch) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2036, in directive > directive_class, match, type_name, option_presets) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2087, in run_directive > result = directive_instance.run() > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > domains/__init__.py", line 190, in run > return BaseDirective.run(self) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/sphinx/ > directives/__init__.py", line 164, in run > self.state.nested_parse(self.content, self.content_offset, > contentnode) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 284, in nested_parse > node=node, match_titles=match_titles) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 195, in run > results = StateMachineWS.run(self, input_lines, input_offset) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 237, in run > context, state, transitions) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > statemachine.py", line 458, in check_line > return method(match, context, next_state) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 2723, in text > paragraph, literalnext = self.paragraph(lines, startline) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 421, in paragraph > textnodes, messages = self.inline_text(text, lineno) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 430, in inline_text > return self.inliner.parse(text, lineno, self.memo, self.parent) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 516, in parse > lineno) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 775, in interpreted_or_phrase_ref > lineno) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/docutils/ > parsers/rst/states.py", line 831, in interpreted > nodes, messages2 = role_fn(role, rawsource, text, lineno, self) > File "/var/virtualenvs/1.3/lib/python2.7/site-packages/django/ > contrib/admindocs/utils.py", line 96, in default_reference_role > context = inliner.document.settings.default_reference_context > AttributeError: Values instance has no attribute > 'default_reference_context' > > Tried disabling admindocs from INSTALLED_APPS but the problem remains. > Is there a known hack or workaround for this, or is it a brand new > django or sphinx error? -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.