--
Ticket URL: <https://code.djangoproject.com/ticket/25602>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* 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>
* 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>
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>
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>
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>