Opened 15 years ago
Closed 10 years ago
#11495 closed Bug (wontfix)
Improvements to django.views.static.serve directory indexes
Reported by: | Chris Beaven | Owned by: | Chris Beaven |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | static |
Cc: | cmawebsite@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
This patch sorts indexes and shows directories before files.
It also adds functionality for providing an index prefix so the template can show the full indexed path correctly.
Attachments (1)
Change History (21)
comment:1 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 15 years ago
Attachment: | 11495.diff added |
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 15 years ago
Triage Stage: | Accepted → Design decision needed |
---|
My view is that it should be consistent no matter what OS is running the server. But pushing do a design decision.
comment:5 by , 14 years ago
milestone: | → 1.3 |
---|---|
Triage Stage: | Design decision needed → Accepted |
I agree with SmileyChris, this should be made consistent across the different OSs.
comment:6 by , 14 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Seems like a good idea. However the new prefix needs to be documented, and this is a good candidate for testing, especially because it might vary across platforms.
comment:7 by , 14 years ago
Summary: | Small improvements to django.views.static.serve directory indexes → Improvements to django.views.static.serve directory indexes |
---|
I've redone this for static-file awareness, patch can be found here:
https://github.com/SmileyChris/django/compare/master...11495-static-directory-indexes
comment:8 by , 14 years ago
milestone: | 1.3 |
---|---|
Triage Stage: | Accepted → Design decision needed |
Hm, that branch goes a bit further than the ticket suggested, also listing all files/folders that the staticfiles finders find. IMO requires more discussion on -dev list.
comment:9 by , 14 years ago
It does, since how indexes currently work with staticfiles now doesn't make a whole lot of sense.
I'm in agreement that it definitely requires more discussion.
comment:10 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
comment:13 by , 12 years ago
Patch needs improvement: | set |
---|
The branch isn't there anymore, any chance to update the patch here?
comment:14 by , 12 years ago
I haven't looked at updating the branch, but it can be found here now (tied to the old django/django github repo):
https://github.com/SmileyChris/django-old/compare/master...11495-static-directory-indexes
comment:16 by , 12 years ago
Triage Stage: | Design decision needed → Accepted |
---|---|
Type: | Cleanup/optimization → Bug |
Version: | 1.0 → master |
Why should views.static.serve consider static file finders? As documented it is just a directory based tool.
I'd move to splitting this into two tickets. Accept this one which has the narrow scope of standardizing the sort order across OS versions for basic static.serve, I think this isn't too contentious.
The issue of how to incorporate static-file finders into index display can be sorted out separately, with its rationale and design proposal.
comment:17 by , 10 years ago
Cc: | added |
---|---|
Keywords: | static added |
I think we should deprecate and remove show_indexes
completely. What do people use it for?
comment:18 by , 10 years ago
It seems show_indexes
dates back to when the view was first added in 572ac3e7dfadec6434527ebbdccef97de1cc191c. I didn't see any mention in the ticket about why this functionality was needed. I guess it makes it a bit easier to debug if you have a typo in a file name or something (rather than opening up a file browser). Collin, can you present your rationale for deprecating it? No doubt some people like it and use it.
comment:19 by , 10 years ago
My goal would be to start fully supporting using static.serve() (or something like it) in production (in 1.9), but we wouldn't want to support show_indexes in production.
Also, as mentioned, now that we have the staticfiles framework, this little feature is a lot harder to get right.
It seems to me, if you want a web index of files, you could just run python3 -m http.server 8080
.
There's also this django-developers discussion: https://groups.google.com/d/topic/django-developers/N0KbgDeLuUE/discussion
comment:20 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Being that the way a directory is sorted is an OS-specific choice, with *nix users getting solidly alphabetic sorting, and Windows users getting folder then file sorting, this should be an either/or option, not a unilateral change.