-
Notifications
You must be signed in to change notification settings - Fork 97
Working with static files (Beast Whoosh front end)
To work with static files (Beast Whoosh front end only) you need to use node to build the css/js/... files, but a number of environment variables must be passed including some Django settings. For that reason we added a custom Django management command that will set the needed env variables and call npm. Also BW frontend uses Django's collectstatic so you need to run that as well in order to copy the generated static files to the correct directory. So far there is no way to automatize this process and it needs to happen manually running the following commands (from the repository root):
# install npm modules (if needed)
npm install
# build static files
python manage.py build_static
# place files in correct colation
python manage.py collectstatic --noinput
To simplify, you can run the following command which includes last two steps:
python manage.py build_and_collect_static
NOTE: BW frontend uses a static files storage which will automatically add hashes to static files filenames and change paths accordingly in templates.
NOTE2: To load Freesound with BW forntend activated, you need to set a request parameter as follows: http..../?fend=bw. To go back to the previous frontend, use http..../?fend=ng.