This "1.8" URL works:
https://docs.djangoproject.com/en/1.8/_modules/django/contrib/auth/forms/
But navigating to the Dev version breaks with 404
--
Ticket URL: <https://code.djangoproject.com/ticket/29942>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
* component: Uncategorized => Documentation
Comment:
It looks like the issue started in Django 1.9. I wonder if the imports
changes in fe914341c83b37fd6aa8fd85620cf49dd2328ab0 may be at fault. I
haven't looked into how `sphinx.ext.viewcode` works.
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:1>
* owner: nobody => Prabakaran Kumaresshan
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:2>
* owner: Prabakaran Kumaresshan => Hasan Ramezani
* has_patch: 0 => 1
Comment:
It is not only `contrib.auth.forms`. here are the missing source code
files list.
{{{
django/db/models/fields/related_descriptors.html
django/contrib/contenttypes/fields.html
django/contrib/contenttypes/admin.html
django/contrib/contenttypes/forms.html
django/contrib/contenttypes/models.html
django/contrib/admin/models.html
django/contrib/admin/apps.html
django/contrib/sessions/base_session.html
django/contrib/auth/validators.html
django/contrib/auth/views.html
django/contrib/auth/mixins.html
django/contrib/auth/middleware.html
django/contrib/auth/backends.html
django/contrib/auth/forms.html
django/contrib/auth/models.html
django/contrib/auth/base_user.html
}}}
from [https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html
Sphinx viewcode extensions]: `Basically, viewcode extension will import
the modules being linked to`.
when Sphinx tries to do for example `import django.contrib.auth.forms`, it
will get
{{{
django.core.exceptions.ImproperlyConfigured: Requested setting
INSTALLED_APPS, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
}}}
So, I created a [https://github.com/django/django/pull/12135 PR] to load
the apps in [https://github.com/django/django/blob/master/docs/conf.py].
But the `docs ` test failed. But in my local machine, it works and missed
source files generated successfully.
I don't know this is a good solution or not. just a PR to start the
discussion.
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:4>
* owner: Hasan Ramezani => Felix Hein
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:5>
Comment (by Felix Hein):
I spent some time trying to understand this issue and the longer I think
about it, the less clear it becomes to me which parts of the source code
should be linked to and which shouldn't.
The list of linked modules at
https://docs.djangoproject.com/en/dev/_modules/ is missing a lot of
modules, which could well be intentional. (That list is the list of files
generated by the viewcode extension, so it contains all the source code
files that are linked to somewhere in the documentation, like here:
https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.)
The modules mentioned in this ticket have not been linked to for a long
time (and thus their source code has not been included in the
`/_modules/..` section of the documentation for that same time). So is
this maybe something that we do not actually want to link to?
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:6>
* cc: Zach Borboa (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:7>
* owner: Felix Hein => Sarah Boyce
* needs_better_patch: 1 => 0
Comment:
https://github.com/django/django/pull/16825
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:8>
* version: 2.1 => dev
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:9>
* stage: Ready for checkin => Accepted
Comment:
Updating the status to "Accepted" as edits have been pushed recently and
need a review :)
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:10>
Comment (by David Smith):
[https://github.com/django/django/pull/16918 New PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:11>
* owner: Sarah Boyce => Joachim Jablon
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:12>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:13>
* owner: Joachim Jablon => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:14>
* owner: (none) => David Smith
* needs_better_patch: 1 => 0
* status: new => assigned
Comment:
[https://github.com/django/django/pull/17613 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29942#comment:15>