mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 23:39:16 +02:00
14 lines
395 B
Python
14 lines
395 B
Python
from django.conf import settings
|
|
|
|
|
|
def full_url(path):
|
|
"""
|
|
Given a relative path, return a full url usable for federation purpose
|
|
"""
|
|
root = settings.FUNKWHALE_URL
|
|
if path.startswith('/') and root.endswith('/'):
|
|
return root + path[1:]
|
|
elif not path.startswith('/') and not root.endswith('/'):
|
|
return root + '/' + path
|
|
else:
|
|
return root + path
|