2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-08 04:40:57 +00:00

[P UI] Make base url configurable (#5577)

* made url_base configurable for P UI

* fixed test for configurable base url
This commit is contained in:
Matthias Mair
2023-09-20 19:39:05 -04:00
committed by GitHub
parent 6c5b9e0108
commit 8432297d3c
8 changed files with 24 additions and 13 deletions

View File

@@ -10,7 +10,11 @@ from django.utils.safestring import mark_safe
logger = getLogger("InvenTree")
register = template.Library()
PUI_SETTINGS = json.dumps(settings.PUI_SETTINGS)
PUI_DEFAULTS = {
'url_base': settings.PUI_URL_BASE,
}
PUI_DEFAULTS.update(getattr(settings, 'PUI_SETTINGS', {}))
PUI_SETTINGS = json.dumps(PUI_DEFAULTS)
@register.simple_tag

View File

@@ -20,12 +20,12 @@ spa_view = ensure_csrf_cookie(TemplateView.as_view(template_name="web/index.html
urlpatterns = [
path('platform/', include([
path(f'{settings.PUI_URL_BASE}/', include([
path("assets/<path:path>", RedirectAssetView.as_view()),
re_path(r"^(?P<path>.*)/$", spa_view),
path("set-password?uid=<uid>&token=<token>", spa_view, name="password_reset_confirm"),
path("", spa_view),]
)),
re_path(r'^platform', spa_view, name='platform'),
path(settings.PUI_URL_BASE, spa_view, name='platform'),
path("assets/<path:path>", RedirectAssetView.as_view()),
]