This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/utils.py

8 lines
219 B
Python

from django.conf import settings
def build_full_absolute_url(request, url):
if request:
return request.build_absolute_uri(url)
else:
return (settings.BLOG["base_url"] + url).replace("//", "/")