Skip to content

Commit 907b7c0

Browse files
committed
Add STATICFILES_DIRS to usage in production
1 parent 37231e4 commit 907b7c0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,16 @@ python manage.py runserver
154154
> ⚠️ You can also check [this example](https://github.com/django-webpack/django-webpack-loader/tree/master/examples/simple) on how to run a project with `django-webpack-loader` and `webpack-bundle-track`.
155155
156156
## Usage in production
157-
We recommend that you keep your local bundles and the stats file outside the version control, having a production pipeline that will compile and collect the assets during the deployment phase. To make sure collectstatic collects the webpack outputs, we recommend disabling automatic collectstatic during the deployment and running it manually. Below are the commands that should be run to achieve this (please note this may change from platform to platform):
157+
We recommend that you keep your local bundles and the stats file outside the version control, having a production pipeline that will compile and collect the assets during the deployment phase. To make sure collectstatic collects the webpack outputs, we recommend disabling automatic collectstatic during the deployment and running it manually.
158+
159+
You must add `STATICFILES_DIRS` to your settings file, pointing to the directory where the static files are located. This will let `collectstatic` know where it should look at:
160+
```python
161+
STATICFILES_DIRS = (
162+
os.path.join(BASE_DIR, 'assets'),
163+
)
164+
```
165+
166+
Below are the commands that should be run to manually collect the static files (please note this may change from platform to platform):
158167
```
159168
npm run build
160169
python manage.py collectstatic --noinput

0 commit comments

Comments
 (0)