openedx-docker icon indicating copy to clipboard operation
openedx-docker copied to clipboard

devstack does not load static files

Open moticanvm opened this issue 5 years ago • 3 comments

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

moticanvm avatar Aug 10 '20 22:08 moticanvm

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

jmaupetit avatar Aug 18 '20 12:08 jmaupetit

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.

moticanvm avatar Oct 31 '20 19:10 moticanvm

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?

jmaupetit avatar Nov 02 '20 15:11 jmaupetit