Skip to content

Commit

Permalink
fix: Force djangoapps to be loaded before we run webpack.
Browse files Browse the repository at this point in the history
In the specific case of webworkers for proctoring, we need to
force Django to load before we run `npm run webpack` so that
the file ../workers.json gets written. See
https://github.com/openedx/edx-proctoring/blob/73c7f55e2be91324fa07fec6e6ac0a667fdd8412/edx_proctoring/apps.py#L46

Also adds JS_ENV_EXTRA_CONFIG, which is required
to create the webworker config.
  • Loading branch information
dianakhuang committed Dec 17, 2024
1 parent e8e4a68 commit f861c19
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
export WEBPACK_CONFIG_PATH=webpack.prod.config.js
export STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles
export STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio
export JS_ENV_EXTRA_CONFIG={}

{% if edxapp_staticfiles_storage_overrides %}
{% for override in edxapp_staticfiles_storage_overrides %}
export STATICFILES_STORAGE={{ override | quote }}
sudo -E -H -u {{ edxapp_user }} \
env "PATH=$PATH" \
npm run webpack \
{{ edxapp_venv_bin }} python manage.py lms --settings=$EDX_PLATFORM_SETTINGS print_setting STATIC_ROOT WEBPACK_CONFIG_PATH \
&& npm run webpack \
&& npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \
&& {{ edxapp_venv_bin }}/python manage.py lms collectstatic --noinput --settings=$EDX_PLATFORM_SETTINGS \
&& {{ edxapp_venv_bin }}/python manage.py cms collectstatic --noinput --settings=$EDX_PLATFORM_SETTINGS
{% endfor %}
{% else %}
sudo -E -H -u {{ edxapp_user }} \
env "PATH=$PATH" \
npm run webpack \
{{ edxapp_venv_bin }} python manage.py lms --settings=$EDX_PLATFORM_SETTINGS print_setting STATIC_ROOT WEBPACK_CONFIG_PATH \
&& npm run webpack \
&& npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \
&& {{ edxapp_venv_bin }}/python manage.py lms collectstatic --noinput --settings=$EDX_PLATFORM_SETTINGS \
&& {{ edxapp_venv_bin }}/python manage.py cms collectstatic --noinput --settings=$EDX_PLATFORM_SETTINGS
Expand Down

0 comments on commit f861c19

Please sign in to comment.