Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#15035 closed (fixed)

collectstatic does not support remote backends that implement modified_time

Reported by: bendavis78 Owned by: jezdez
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: UI/UX:


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 bendavis78 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by bendavis78

comment:1 Changed 6 years ago by jezdez

  • Component changed from Uncategorized to Contrib apps
  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jezdez
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from SVN to 1.3-beta

Can you please check if this also works?

comment:2 Changed 6 years ago by bendavis78

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 6 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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