#14524 closed (fixed)
Accessing /static/ in a new project shows simplistic 404 error page
Reported by: | Fletcher Tomalty | Owned by: | Jannis Leidel |
---|---|---|---|
Component: | Contrib apps | Version: | dev |
Severity: | Keywords: | static, files | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
- Start a brand new project on the latest development version
- Use manage.py runserver
- Navigate to localhost:8000/static/
- See weird, undjango-like plain-text error page saying only "Page not found: /static/"
It looks like the addition of staticfiles caused new projects to serve static files on /static/ by default, which I'm pretty sure is a bug.
Change History (5)
comment:1 by , 14 years ago
milestone: | → 1.3 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Summary: | revision 14293 introduced static/ bug → Accessing /static/ in a new project shows simplistic 404 error page |
---|
comment:3 by , 14 years ago
Why would accessing /static/ trigger a "Permission denied: /media/" error? In previous versions /static/ gave the normal "It worked!" default page I think. The only reason there should be ANY 404s on either /static/ or /media/ is if you explicitly make one of them the location you are serving static files such as the admin media from. The admin isn't even on by default, and as far as I know there simply is no reason for /static/ or /media/ to work differently than any other pages on a new install.
Having said that, I'm a bit of a Django newbie what I write reflects my simple understanding of what's supposed to happen -- I could have misunderstood something entirely, in which case I apologize.
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [14533]) Fixed #14524, #14582, #14617, #14665 and #14667 -- Tweaked staticfiles app.
- Updated StaticFilesHandler and AdminMediaHandler to make use of the 404 handler if needed.
- Updated runserver management command to serve static files only in DEBUG mode (or if specified the --insecure option) and if the staticfiles app is in INSTALLED_APPS. Also added an option to disable serving completely (--nostatic).
- Added check in debug mode if STATICFILES_* settings are different to MEDIA_* settings.
- Removed a faulty PendingDeprecationWarning in AdminMediaHandler that is triggered every time runserver is used.
- Fixed an issue with the modification time checks when running collectstatic.
- Extended and refined documentation.
Thanks to everyone for input, especially to Carl Meyer, Ted Kaemming and
Adam Vandenberg for patches.
In previous versions this triggered a "Permission denied: /media/" error (in the same appearance), which is slightly less useful IMO and not really better than now. Question is we should return a standard 404 page instead.