Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#14665 closed (fixed)

collectstatic will recollect some files all the time.

Reported by: Florian Apolloner Owned by: Jannis Leidel
Component: Contrib apps Version: dev
Severity: Keywords: staticfiles mtime
Cc: Florian Apolloner Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Apparently getmtime returns different results due to some rounding errors thx to using floats for the time. os.stat_float_times(False) in collectstatic fixes it. Another solution would be to make the comparison accept an small offset (0.146508 seconds aren't that useful after all).

Change History (4)

comment:1 Changed 11 years ago by Florian Apolloner

I also think, that the comparison should be dest_mtime >= source_mtime, as I doubt we can rely on the backend (read any non local backend) to not change the mtime.

comment:2 Changed 11 years ago by Jannis Leidel

Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 Changed 11 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 10 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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