Use sites framework to get current site

This commit is contained in:
R. Miles McCain
2020-04-14 17:21:54 -04:00
parent 579c162365
commit 6d542e81e5
11 changed files with 27 additions and 20 deletions

View File

@@ -29,11 +29,3 @@ class DateRangeMixin:
data["start_date"] = self.get_start_date()
data["end_date"] = self.get_end_date()
return data
class BaseUrlMixin:
def get_context_data(self, **kwargs):
data = super().get_context_data(**kwargs)
url_data = urlparse(self.request.build_absolute_uri())
data["base_url"] = f"{url_data.scheme}://{url_data.netloc}"
return data