Opened 10 years ago
Closed 10 years ago
#24510 closed Cleanup/optimization (fixed)
FileField.upload_to documentation misleading
Reported by: | Markus Bertheau | Owned by: | Matt Seymour |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to it says:
A local filesystem path that will be appended to your MEDIA_ROOT setting to determine the value of the url attribute.
While this may be true with the default storage, it's misleading because it suggests that this behaviour (append to MEDIA_ROOT to get the URL) can't be changed. It's also the first sentence and main explanation for upload_to
, which increases the severity of the misleading.
In particular, you might want to make uploaded files not available to the general public, i.e. use a storage with base_url
set to None
. The first sentence sounds like you have to hack around django to implement that.
Change History (5)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
If you'd like to draft a patch, I'll be happy to review it.
comment:3 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 10 years ago
Easy pickings: | set |
---|---|
Has patch: | set |
Pull request added at github https://github.com/django/django/pull/4396
Also, if what's in the first sentence is really the main purpose and way of functioning for
upload_to
, thenupload_to
is a misnomer.