[Django] #25602: Django breaks sphinx

27 views
Skip to first unread message

Django

unread,
Oct 23, 2015, 2:54:16 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------
Reporter: amikrop | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
I try to use sphinx-apidoc on my Django app, but when I run "make html" I
get an error. I have tried everything I found as solutions, but with no
luck.

--
Ticket URL: <https://code.djangoproject.com/ticket/25602>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 23, 2015, 2:58:36 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------------------------

Reporter: amikrop | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by amikrop):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

> I try to use sphinx-apidoc on my Django app, but when I run "make html" I
> get an error. I have tried everything I found as solutions, but with no
> luck.

New description:

I try to use sphinx-apidoc on my Django app, but when I run "make html" I
get an error. I have tried everything I found as solutions, but with no
luck.

conf.py https://bpaste.net/show/c10e9d3877bf

traceback https://bpaste.net/show/d2451bcd91fd

the app is this one https://github.com/amikrop/django-uaccounts/ and I put
the docs directory right in the root

--

--
Ticket URL: <https://code.djangoproject.com/ticket/25602#comment:1>

Django

unread,
Oct 23, 2015, 3:30:21 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------------------------
Reporter: amikrop | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => invalid


Comment:

I'd guess you need to call `django.setup()` somewhere as described in the
first question in the
[https://docs.djangoproject.com/en/stable/ref/applications/#troubleshooting
Applications Troubleshooting].

Please see TicketClosingReasons/UseSupportChannels if you need further
help.

--
Ticket URL: <https://code.djangoproject.com/ticket/25602#comment:2>

Django

unread,
Oct 23, 2015, 7:44:09 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------------------------
Reporter: amikrop | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by amikrop):

django.setup() did not help no matter where I put it in conf.py
I would appreciate further investigation/help.

django.setup() after settings.configure(): https://dpaste.de/aekd

django.setup() before settings.configure():
https://bpaste.net/show/730b6345ee5e

--
Ticket URL: <https://code.djangoproject.com/ticket/25602#comment:3>

Django

unread,
Oct 23, 2015, 9:23:38 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------------------------
Reporter: amikrop | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by amikrop):

After all I managed to do it by monkeypatching FileDescriptor's
{{{
__get__
}}}
in conf.py. First, I needed to be in a Django project, not enough to just
be in a "projectless" app. Second, it needed manual setting of environment
variable DJANGO_SETTINGS_MODULE, which settings.configure() couldn't do.
And third it needed the monkeypatch. These were the lines needed in
conf.py:


{{{
sys.path.insert(0, os.path.abspath('..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

import django
django.setup()

from django.db.models.fields.files import FileDescriptor
FileDescriptor.__get__ = lambda self, *args, **kwargs: self
}}}


I mentioned it for future reference and it would be nice if it could all
be documented together.

--
Ticket URL: <https://code.djangoproject.com/ticket/25602#comment:4>

Django

unread,
Oct 23, 2015, 9:40:50 PM10/23/15
to django-...@googlegroups.com
#25602: Django breaks sphinx
-------------------------------+--------------------------------------
Reporter: amikrop | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timgraham):

I think the issue with `FileDescriptor` will be fixed in Django 1.10
(#21042).

--
Ticket URL: <https://code.djangoproject.com/ticket/25602#comment:5>

Reply all
Reply to author
Forward
0 new messages