Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#14617 closed (fixed)

Docs should mention runserver's automatic serving of static files

Reported by: Chris Beaven Owned by: Jannis Leidel
Component: Documentation Version:
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Specifically, here:

I'm assigning to jezdez but I'm sure he'd appreciate anyone throwing a doc patch up :)

Change History (5)

comment:1 Changed 7 years ago by Jannis Leidel

Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Carl Meyer

I have some documentation improvements (hopefully!) here:

Some things I'm not satisfied with / sure about:

  1. I think staticfiles actually needs to provide a little better help in the area of serving MEDIA_URL in development than it currently does, which will mean updating the doc I wrote for that. I'll look at that more and perhaps file a separate ticket with a patch.
  1. I believe the plan is to make a change so StaticFilesHandler is only enabled if you put contrib.staticfiles in INSTALLED_APPS. Based on this, I haven't added a backwards-incompatibility note in the release notes about automatic serving of STATIC_URL, which I think would otherwise be needed. In any case, if that change is made it will need to be mentioned in the docs as well.

comment:3 Changed 7 years ago by Carl Meyer

This django-developers post is relevant to how this patch still needs improvement:

comment:4 Changed 7 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

(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.

comment:3 Changed 7 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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