Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Support collectstatic #38

Open
jbinney opened this issue Dec 30, 2015 · 0 comments
Open

Support collectstatic #38

jbinney opened this issue Dec 30, 2015 · 0 comments

Comments

@jbinney
Copy link
Contributor

jbinney commented Dec 30, 2015

Right now, python-webpack supports findstatic, which is used by Django to locate and serve static files during development. However, it doesn't support collectstatic, which is used by Django to gather all static files and move them into STATIC_ROOT for deployment. It seems that python-webpack bypasses collectstatic by outputting webpack_assets directly into the STATIC_ROOT directory, with the assumption that you will simply sync the STATIC_ROOT directory with your static server (e.g. S3). Unfortunately, many people use django-storages (example), which relies on the collectstatic step to sync static files with S3.

Fortunately, the only necessary change to support collectstatic is removing the list() override in WebpackFinder - the implementation in BaseStorageFinder works just fine. If we want collectstatic to work properly though, we shouldn't encourage people to output webpack_assets directly to STATIC_ROOT anymore, as this can cause issues like this. I'm proposing changing the name of this setting to OUTPUT_ROOT and recommending people set it to something like BASE_DIR+'generated_assets'. Of course, if people aren't interested in using collectstatic, they can still set OUTPUT_ROOT=STATIC_ROOT and get the same behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant