Opened 7 years ago

Closed 7 years 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 by Jesse, 7 years ago

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 by Jake Barber, 7 years ago

Owner: changed from nobody to Jake Barber
Status: newassigned

comment:3 by Jake Barber, 7 years ago

Has patch: set

comment:4 by Jake Barber, 7 years ago

Type: UncategorizedCleanup/optimization

comment:5 by Tim Graham, 7 years ago

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