mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Remove fallback on BASE_URL
This commit is contained in:
parent
1e4417ae0c
commit
1a0344216c
@ -24,10 +24,6 @@ This is the base URL used by the Wagtail admin site. It is typically used for ge
|
||||
|
||||
If this setting is not present, Wagtail will try to fall back to `request.site.root_url` or to the request's host name.
|
||||
|
||||
```{versionchanged} 3.0
|
||||
This setting was previously named ``BASE_URL`` and was undocumented, using ``BASE_URL`` will be removed in a future release.
|
||||
```
|
||||
|
||||
(append_slash)=
|
||||
|
||||
## Append Slash
|
||||
|
@ -1,26 +1,12 @@
|
||||
from warnings import warn
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.http import url_has_allowed_host_and_scheme
|
||||
|
||||
from wagtail.utils.deprecation import RemovedInWagtail50Warning
|
||||
|
||||
|
||||
def get_admin_base_url():
|
||||
"""
|
||||
Gets the base URL for the wagtail admin site. This is set in `settings.WAGTAILADMIN_BASE_URL`,
|
||||
which was previously `settings.BASE_URL`.
|
||||
Gets the base URL for the wagtail admin site. This is set in `settings.WAGTAILADMIN_BASE_URL`.
|
||||
"""
|
||||
|
||||
admin_base_url = getattr(settings, "WAGTAILADMIN_BASE_URL", None)
|
||||
if admin_base_url is None and hasattr(settings, "BASE_URL"):
|
||||
warn(
|
||||
"settings.BASE_URL has been renamed to settings.WAGTAILADMIN_BASE_URL",
|
||||
category=RemovedInWagtail50Warning,
|
||||
)
|
||||
admin_base_url = settings.BASE_URL
|
||||
|
||||
return admin_base_url
|
||||
return getattr(settings, "WAGTAILADMIN_BASE_URL", None)
|
||||
|
||||
|
||||
def get_valid_next_url_from_request(request):
|
||||
|
Loading…
Reference in New Issue
Block a user