mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 23:49:16 +02:00
16 lines
324 B
Python
16 lines
324 B
Python
import requests
|
|
from django.conf import settings
|
|
|
|
import funkwhale_api
|
|
|
|
|
|
def get_user_agent():
|
|
return "python-requests (funkwhale/{}; +{})".format(
|
|
funkwhale_api.__version__, settings.FUNKWHALE_URL
|
|
)
|
|
|
|
|
|
def get_session():
|
|
s = requests.Session()
|
|
s.headers["User-Agent"] = get_user_agent()
|
|
return s
|