This is an API for a choreography library application that allows users to record and search pieces of choreographies created by multiple choreographers. This API is developed using the Django REST Framework. I created this project to teach myself DRF and express my love for dancing. The application is containerized using Docker and deployed to AWS EC2.
- EC2 instance address: http://ec2-54-183-149-150.us-west-1.compute.amazonaws.com:8000
- You can also visit from https://yunchipang.github.io/drf-choreo-library
With this API, you can...
- create user account - registration
- login and logout - authentication & authorization
- create, view, update, and delete a piece of choreography in your user account
$ git clone https://github.com/yunchipang/drf-choreo-library.git
$ cd drf-choreo-library
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py runserver
The REST API to the choreos
app is described below.
visit /register
endpoint and post your username and password. For example,
{
"username": "newuserabc",
"password": "password123",
}
After the new user has been created, you will be able to log in using this pair of username and password.
GET /choreos/
curl -i -H 'Accept: application/json' http://localhost:8000/choreos/
HTTP/1.1 200 OK
Date: Tue, 21 Feb 2023 07:03:00 GMT
Server: WSGIServer/0.2 CPython/3.11.2
Content-Type: application/json
Vary: Accept, Cookie
Allow: GET, POST, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 396
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
[]
POST /choreos/
curl -i -H 'Accept: application/json' -d 'choreographer=Leejung Lee&&music_title=LALISA&style=k-pop' http://localhost:8000/choreos/ --user "username:password"
HTTP/1.1 201 Created
Date: Tue, 21 Feb 2023 07:12:24 GMT
Server: WSGIServer/0.2 CPython/3.11.2
Content-Type: application/json
Vary: Accept, Cookie
Allow: GET, POST, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 153
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
{"id":3,"created":"2023-02-21T07:12:24.058032Z","choreographer":"Leejung Lee","music_title":"LALISA","style":"k-pop","video_url":"","owner":"yunchipang"}
GET /choreos/id/
curl -i -H 'Accept: application/json' http://localhost:8000/choreos/1/
HTTP/1.1 200 OK
Date: Tue, 21 Feb 2023 07:16:38 GMT
Server: WSGIServer/0.2 CPython/3.11.2
Content-Type: application/json
Vary: Accept, Cookie
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 167
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
{"id":1,"created":"2023-02-21T04:52:00.722810Z","choreographer":"xxxxx","music_title":"xxxxx","style":"xxxxx","video_url":"xxxxx","owner":"xxxxx"}