Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#15035 closed (fixed)

collectstatic does not support remote backends that implement modified_time

Reported by: Ben Davis Owned by: Jannis Leidel
Component: Contrib apps Version: 1.3-beta
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


My CDN (rackspace cloud files) supports getting the modified time of an object. If I implement modified_time() in my cloud storage app, we get an exception:

Traceback (most recent call last):
  File "./", line 26, in <module>
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/management/", line 429, in execute_from_command_line
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/management/", line 379, in execute
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/management/", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/management/", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/management/", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/contrib/staticfiles/management/commands/", line 78, in handle_noargs
    self.copy_file(source, prefix, storage, **options)
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/contrib/staticfiles/management/commands/", line 130, in copy_file
  File "/home/ben/Projects/SavidWorks/ellableu/.env/src/django/django/core/files/", line 86, in path
    raise NotImplementedError("This backend doesn't support absolute paths.")
NotImplementedError: This backend doesn't support absolute paths.

This can be fixed by setting destination_is_link to False when self.distination_local is False. Patch is attached.

Attachments (1)

collectstatic_remote_modified_time_fix.diff (780 bytes) - added by Ben Davis 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Ben Davis

comment:1 Changed 13 years ago by Jannis Leidel

Component: UncategorizedContrib apps
milestone: 1.3
Owner: changed from nobody to Jannis Leidel
Status: newassigned
Triage Stage: UnreviewedAccepted
Version: SVN1.3-beta

Can you please check if this also works?

comment:2 Changed 13 years ago by Ben Davis

Yup, works for me. Thanks!

Also thanks for leading me to discover that Django has an official git clone -- that makes me all types of happy :-D

comment:3 Changed 13 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

(In [15154]) Fixed #15035 -- Fixed collectstatic management command to work with non-local storage backends correctly. Also refactored a bit code smell.

comment:4 Changed 12 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

comment:5 Changed 7 years ago by Tim Graham <timograham@…>

In bff4abac:

Refs #15035 -- Corrected a bug and improved comments for a staticfiles test.

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