libretime/api
Jonas L d55e58e416
chore: auto generate requirements.txt (#1651)
- force LC_ALL for the sort command
2022-02-28 20:02:01 +02:00
..
install/systemd feat(api): improve uwsgi systemd integration (#1614) 2022-02-19 09:03:25 +02:00
libretime_api feat(legacy): add db config defaults and allow custom port (#1559) 2022-02-04 16:03:01 +02:00
Makefile test(api): add bandit linter check 2022-02-14 21:01:35 +02:00
README.md chore: fixes after libretime_api rename 2022-01-04 09:18:58 +02:00
packages.ini chore: rename common section to python (#1509) 2022-01-13 07:12:50 +02:00
pyproject.toml chore: make linters config consistent in pyproject.toml 2022-01-26 10:15:35 +02:00
requirements.txt chore: auto generate requirements.txt (#1651) 2022-02-28 20:02:01 +02:00
setup.py chore: make setup.py file chdir consistent 2022-01-26 10:15:35 +02:00

README.md

LibreTime API

This API provides access to LibreTime's database via a Django application. This API supersedes the PHP API.

Deploying

Deploying in a production environment is done in the install script which installs LibreTime. This is how the API is installed in the Vagrant development images too. This method does not automatically reflect changes to this API. After any changes, the libretime-api systemd service needs restarting:

sudo systemctl restart libretime-api

Connections to the API are proxied through the Apache web server by default. Endpoint exploration and documentation is available from http://example.com/api/v2/schema/swagger-ui/, where example.com is the URL for the LibreTime instance.

Development

For a live reloading version within Vagrant:

vagrant up debian-buster
# Run through the web setup http://localhost:8080
vagrant ssh debian-buster
sudo systemctl stop libretime-api
sudo systemctl restart libretime-analyzer libretime-celery libretime-liquidsoap libretime-playout
cd /vagrant/api
sudo pip3 install -e .
sudo -u www-data LIBRETIME_DEBUG=True libretime-api runserver 0.0.0.0:8081

Unit tests can be run in the vagrant environment using

sudo -u www-data LIBRETIME_DEBUG=True libretime-api test libretime_api

3rd Party Licences

libretime_api/tests/resources/song.mp3: Steps - Tears On The Dancefloor (Album Teaser) by mceyedol. Downloaded from https://soundcloud.com/mceyedol/steps-tears-on-the-dancefloor-album-teaser released under a Creative Commons Licence (cc-by-sa-nc-sa)