diff --git a/boot.sh b/boot.sh index 41a368d5f6..03f6e82dab 100644 --- a/boot.sh +++ b/boot.sh @@ -81,6 +81,7 @@ python manage.py migrate echo "Collecting static files, this may take a while..." +python manage.py collectstatic_js_reverse python manage.py collectstatic --noinput echo "Done" diff --git a/recipes/settings.py b/recipes/settings.py index 97b8a3b7d7..baa95019c2 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -182,6 +182,7 @@ def extract_comma_list(env_key, default=None): 'django_cleanup.apps.CleanupConfig', 'webpack_loader', 'django_vite', + 'django_js_reverse', 'hcaptcha', 'allauth', 'allauth.account', diff --git a/recipes/urls.py b/recipes/urls.py index 598bbce5db..9d251c10ff 100644 --- a/recipes/urls.py +++ b/recipes/urls.py @@ -21,6 +21,7 @@ from django.urls import include, path, re_path from django.views.i18n import JavaScriptCatalog from django.views.static import serve +from django_js_reverse import views as reverse_views urlpatterns = [ path('', include('cookbook.urls')), @@ -42,6 +43,7 @@ if settings.GUNICORN_MEDIA or settings.DEBUG: urlpatterns += re_path(r'^media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT}), + urlpatterns += re_path(r'^jsreverse.json$', reverse_views.urls_js, name='js_reverse'), for p in settings.PLUGINS: try: