Opened 21 months ago

Last modified 8 months ago

#29942 assigned Bug

viewsource links to contrib.auth.forms not appearing

Reported by: Yemar Nevets Owned by: Hasan Ramezani
Component: Documentation Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Change History (4)

comment:1 Changed 21 months ago by Tim Graham

Component: UncategorizedDocumentation
Summary: URL is brokenviewsource links to contrib.auth.forms not appearing
Triage Stage: UnreviewedAccepted

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.

comment:2 Changed 21 months ago by Prabakaran Kumaresshan

Owner: changed from nobody to Prabakaran Kumaresshan
Status: newassigned

comment:3 Changed 9 months ago by Hasan Ramezani

Has patch: set
Owner: changed from Prabakaran Kumaresshan to Hasan Ramezani

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 Changed 8 months ago by felixxm

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top