Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:00:01+00:00 2026-06-18T01:00:01+00:00

We recently moved to Heroku avec we decided to store our assets on Amazon

  • 0

We recently moved to Heroku avec we decided to store our assets on Amazon S3 with a Cloudfront distribution.

I use Django Pipeline to compress / compile my assets but I didn’t manage to make it points to the correct version.
When I run the “collectstatic” management command, it works well:

Post-processed ‘css/compress_profile_school.css’ as ‘css/compress_profile_school.82973855aca5.css
Post-processed ‘css/compress_profile.css’ as ‘css/compress_profile.d120536e24f9.css
Post-processed ‘css/compress_document.css’ as ‘css/compress_document.864dd7603769.css
…

But when I run the app, it didn’t point to the correct version (it uses the one with no hash).

The application is running here: http://dev.unishared.com/

It seems that the Django bundled staticfiles app can’t point to the correct version too.

Each time I push new assets version, I have to invalidate my Cloudfront distribution which takes time..

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:00:02+00:00Added an answer on June 18, 2026 at 1:00 am

    Thanks to cyberdelia I managed to make it works.

    First, the “CachedFilesStorage” only put hashname in the filenames if your DEBUG settings is turned off (= False).
    It runs well on my production server.

    From here, the “collectstatic” command is uploading the right files on S3 (with hash in the name).
    I met a second problem: the URL cached is pointing to the S3 Bucket but not the Cloudfront defined in the “STATIC_URL” setting.
    I think it’s related to django-storages / boto used by my custom storage which works with S3 and not Cloudfront:

    class S3PipelineStorage(PipelineMixin, CachedFilesMixin, StaticStorage):
    pass
    

    (Static storage is a S3BotoStorage subclass with location sets to “static”).

    Now, I have to find a way to make it works properly with Cloudfront and not S3.

    Thanks for your help!

    EDIT:

    I figured out to make it works via this post: Django-compressor: how to write to S3, read from CloudFront?

    While you define the “custom domain” key, it will use the Cloudfront domain instead of the Amazon S3.

    I forgot to mention that I had to put the AWS_QUERYSTRING_AUTH to False to make it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently moved my RoR app on the Heroku platform, and almost everything
We recently moved our github from one account owner to another, and now all
We recently moved our Windows CE application to the SD Card. Since then the
Recently moved from svn to git, pardon my newbie question. In our release process,
We recently moved our database from our SQL Server 2005 server to our SQL
I've recently moved host's, whomever owned our ip previously obviously ran some kind of
I have recently moved our TFS 2010 server to new server, when I'm trying
We recently moved our SVN server from one data center to another, and the
I recently moved a project on github and I still use this library in
I recently moved to the MS environment where we use SQL Server. I'm struggling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.