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

Base URL configuration options (#4749)

* Improve construct_absolute_url method

- Look for hard-coded site URL if provided
- Otherwise look for specified site URL
- Otherwise look at the provided request object

* Refactor existing code which used base URL setting

* Update docs

* Validate that a provided base URL is valid
This commit is contained in:
Oliver
2023-05-02 22:14:57 +10:00
committed by GitHub
parent 10c3d101e8
commit 61d613ff34
9 changed files with 75 additions and 33 deletions

View File

@@ -222,8 +222,8 @@ def inventree_splash(**kwargs):
@register.simple_tag()
def inventree_base_url(*args, **kwargs):
"""Return the INVENTREE_BASE_URL setting."""
return InvenTreeSetting.get_setting('INVENTREE_BASE_URL')
"""Return the base URL of the InvenTree server"""
return InvenTree.helpers.get_base_url()
@register.simple_tag()