Opened 6 years ago
Closed 7 months ago
#29942 closed Bug (fixed)
viewsource links to contrib.auth.forms not appearing
Reported by: | Yemar Nevets | Owned by: | David Smith |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Zach Borboa | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Dev URL borken: https://docs.djangoproject.com/en/dev/_modules/django/contrib/auth/forms/
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
Change History (27)
comment:1 by , 6 years ago
Component: | Uncategorized → Documentation |
---|---|
Summary: | URL is broken → viewsource links to contrib.auth.forms not appearing |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 5 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
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 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 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.
comment:4 by , 5 years ago
Patch needs improvement: | set |
---|
comment:5 by , 2 years ago
Owner: | changed from | to
---|
comment:6 by , 2 years ago
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?
comment:7 by , 2 years ago
Cc: | added |
---|
comment:8 by , 20 months ago
Owner: | changed from | to
---|---|
Patch needs improvement: | unset |
comment:9 by , 19 months ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | 2.1 → dev |
comment:10 by , 19 months ago
Triage Stage: | Ready for checkin → Accepted |
---|
Updating the status to "Accepted" as edits have been pushed recently and need a review :)
comment:12 by , 19 months ago
Owner: | changed from | to
---|
comment:13 by , 17 months ago
Patch needs improvement: | set |
---|
comment:14 by , 14 months ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:15 by , 11 months ago
Owner: | set to |
---|---|
Patch needs improvement: | unset |
Status: | new → assigned |
comment:16 by , 10 months ago
Patch needs improvement: | set |
---|
comment:17 by , 9 months ago
Patch needs improvement: | unset |
---|
comment:18 by , 9 months ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Setting as patch needs improvements following review from yesterday.
comment:19 by , 9 months ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:20 by , 8 months ago
Patch needs improvement: | set |
---|
Branch is pretty much ready for merge though there is a tiny pending detail about better error reporting when calling importlib.util.resolve_name(name=imported_path, package=module)
. Setting the needs improvement flag to track that item.
comment:21 by , 7 months ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
follow-up: 26 comment:23 by , 7 months ago
hi. this ticket is marked fixed, but the dev URL mentioned in the description[1] still 404s.
[1] https://docs.djangoproject.com/en/dev/_modules/django/contrib/auth/forms/
comment:24 by , 7 months ago
Resolution: | fixed |
---|---|
Severity: | Normal → Release blocker |
Status: | closed → new |
Triage Stage: | Ready for checkin → Accepted |
Probably the documentation hasn't been updated since this change due to a Python 3.8 incompatibility.
comment:26 by , 7 months ago
Replying to Zach Borboa:
hi. this ticket is marked fixed, but the dev URL mentioned in the description[1] still 404s.
[1] https://docs.djangoproject.com/en/dev/_modules/django/contrib/auth/forms/
Hello Zach,
As Tim mentioned, we did land a fix but it wasn't available because of a docs build issue in our building server. We have now fixed that and the linking to source code is available via the "[source]" link in the docs, for example in https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.forms.PasswordChangeForm there is a link to https://github.com/django/django/blob/main/django/contrib/auth/forms.py#L488
The fix for this issue included migrating from one Sphinx extension (viewcode) to another (linkcode), so now the docs include links to the source code directly in GitHub.
comment:27 by , 7 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Docs build failure fixed in 15fff62d5d8f28b6b61d63341535c9aafc64c865 and confirmed docs now build correctly in both RTD and our server.
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.