django / django/djangoproject.com

Docs have incorrect links to source.

Open
#2,091 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2k
Forks
1.1k
Avg merge
2d 4h
Merged PRs (30d)
24

Description

A ticket has been opened on trac [#36450](https://code.djangoproject.com/ticket/36450) where the issue is that the `[source]` links in the docs have incorrect line numbers.

I've checked out `main` and `5.2` locally and built the docs. These generate the correct links back to the source code on GitHub.

All versions of the docs since 5.1 (the version where the switch to link to github source was made) seem to be using the same line number.

Looking at some timelines.

3rd March -- Commit which changed the line number for `sum()` https://github.com/django/django/commit/4b977a5d7283e7ca51288cc0ed0860e0004653ca
12th March -- 5.1 has correct link: https://web.archive.org/web/20250312194141/https://docs.djangoproject.com/en/5.1/ref/models/querysets/
17th March -- 5.1 has incorrect link https://web.archive.org/web/20250317143719/https://docs.djangoproject.com/en/5.1/ref/models/querysets/

During this period some changes were made to the global state of Sphinx.

https://github.com/django/djangoproject.com/pull/1983
https://github.com/django/djangoproject.com/pull/1984

I'm guessing it's these commits which resulted in the change of behaviour?

cc @sarahboyce

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the Sphinx global-state changes in djangoproject.com pull requests 1983 and 1984, then compare locally built docs from main and 5.2. Confirm the fix by checking that generated [source] links use the current GitHub line numbers, including the QuerySet sum() example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.