написал запрос на получение всех треков
This commit is contained in:
parent
c3f3e30ad4
commit
a99228f5c6
|
|
@ -174,6 +174,17 @@ class SongViewSet(GenericViewSet):
|
|||
except ObjectDoesNotExist:
|
||||
return Response({"error": 'Объекта не существует'}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
@action(detail=False, methods=['get'])
|
||||
def get_all_song(self, request):
|
||||
file_url = "http://82.97.242.49:10084/api/station/1/files"
|
||||
API_KEY = "49226d3488aac3f5:18d88659c6c1c5e131a0ce0a94d55235"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {API_KEY}"
|
||||
}
|
||||
response = requests.get(file_url, headers=headers)
|
||||
|
||||
return Response(response.json(), status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue