#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.df24b98f6db7ae171ef763f5a65afdfd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.