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:
@@ -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
|
||||
|
@@ -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()),
|
||||
]
|
||||
|
Reference in New Issue
Block a user