devstack does not load static files
After installing hawthorn bare, I am able to start the production version. However, both, the lms and the studio on the production side does not load the static files at all. I get a 404 for javascript files., csss etc.
Any ideas?
Thanks
Hi @moticanvm :wave:
With production settings, we use nginx to serve static/media files (and not Django's development server). Hence, you need to collect static files using the dev-assets Makefile target:
$ make dev-assets
Reference: https://github.com/openfun/openedx-docker/blob/master/Makefile#L194
Hi everyone,
Since we do not have a straight way to collect files, I propose to include the following Makefile commands:
dev-gen-static-lms: ## run update_assets to copy required statics in local volumes
$(COMPOSE_RUN) --no-deps lms-dev \
python manage.py lms collectstatic --link --noinput --settings=fun.docker_run
.PHONY: dev-gen-static-lms
dev-gen-static-cms: ## run update_assets to copy required statics in local volumes
$(COMPOSE_RUN) --no-deps lms-dev \
python manage.py cms collectstatic --link --noinput --settings=fun.docker_run
.PHONY: dev-gen-static-cms
Then all the statics file will be generated into <release_folder>/data/static/development
After, I also propose two solution for updating the static files. The first will be include a new command on the Makefile to push the static files to nginx + edx production using the command docker cp, or just make the /data/static/production folder a docker volume for nginx container.
I am sorry @moticanvm, I am not sure that: 1. my first answer was relevant, and, 2. what kind of issue you are facing.
Can you please reformulate your issue? Static files are missing with production or development settings ? Or both?