Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devstack does not load static files #235

Open
moticanvm opened this issue Aug 10, 2020 · 3 comments
Open

devstack does not load static files #235

moticanvm opened this issue Aug 10, 2020 · 3 comments
Labels

Comments

@moticanvm
Copy link

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

@jmaupetit
Copy link
Contributor

Hi @moticanvm 👋

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

@moticanvm
Copy link
Author

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.

@jmaupetit
Copy link
Contributor

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?

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

No branches or pull requests

2 participants