Opened 5 years ago
Last modified 9 days ago
#29942 assigned Bug
viewsource links to contrib.auth.forms not appearing
Reported by: | Yemar Nevets | Owned by: | David Smith |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Zach Borboa | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
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 (20)
comment:1 by , 5 years ago
Component: | Uncategorized → Documentation |
---|---|
Summary: | URL is broken → viewsource links to contrib.auth.forms not appearing |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 4 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 , 4 years ago
Patch needs improvement: | set |
---|
comment:5 by , 19 months ago
Owner: | changed from | to
---|
comment:6 by , 19 months 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 , 18 months ago
Cc: | added |
---|
comment:8 by , 12 months ago
Owner: | changed from | to
---|---|
Patch needs improvement: | unset |
comment:9 by , 11 months ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | 2.1 → dev |
comment:10 by , 11 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 , 11 months ago
Owner: | changed from | to
---|
comment:13 by , 9 months ago
Patch needs improvement: | set |
---|
comment:14 by , 6 months ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:15 by , 3 months ago
Owner: | set to |
---|---|
Patch needs improvement: | unset |
Status: | new → assigned |
comment:16 by , 2 months ago
Patch needs improvement: | set |
---|
comment:17 by , 5 weeks ago
Patch needs improvement: | unset |
---|
comment:18 by , 4 weeks ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Setting as patch needs improvements following review from yesterday.
comment:19 by , 2 weeks ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:20 by , 9 days 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.
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.