Opened 3 months ago

Closed 6 weeks ago

#28547 closed Cleanup/optimization (worksforme)

Documentation unclear if 'redirect' shortcut encodes the url or expects it to be encoded

Reported by: Jesse Owned by: Jake Barber
Component: Documentation Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Would be helpful to include a note under the docs for redirect to say that it will automatically encode the URL for you.

Change History (5)

comment:1 Changed 3 months ago by Jesse

Summary: Documentation unclear if 'redirect' shortcut encodes the url itself or expects it to be encodedDocumentation unclear if 'redirect' shortcut encodes the url or expects it to be encoded

comment:2 Changed 2 months ago by Jake Barber

Owner: changed from nobody to Jake Barber
Status: newassigned

comment:3 Changed 2 months ago by Jake Barber

Has patch: set

comment:4 Changed 2 months ago by Jake Barber

Type: UncategorizedCleanup/optimization

comment:5 Changed 6 weeks ago by Tim Graham

Resolution: worksforme
Status: assignedclosed

As discussed in the PR, I don't see a need for clarification here. Django will automatically do the appropriate encoding as needed when it generates a URL. The confusion that lead to this ticket was the case, "An absolute or relative URL, which will be used as-is for the redirect location." The documentation is indeed correct (Django doesn't add encoding for those URLs). The confusion was about browsers adding encoding to URLs, however, this topic seems out of scope for Django's documentation as there's nothing specific about the redirect() view that would merit a special mention of the behavior.

Note: See TracTickets for help on using tickets.
Back to Top