https://github.com/lenixbyte/django-restapi
REST API in django app with view, filter, and registration.
https://github.com/lenixbyte/django-restapi
django-project python3 rest-api
Last synced: about 1 year ago
JSON representation
REST API in django app with view, filter, and registration.
- Host: GitHub
- URL: https://github.com/lenixbyte/django-restapi
- Owner: lenixbyte
- Created: 2023-02-21T05:12:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-21T05:14:09.000Z (over 3 years ago)
- Last Synced: 2025-02-02T15:46:08.433Z (over 1 year ago)
- Topics: django-project, python3, rest-api
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Endpoints for Django RestApi Application
This project provides a REST API for an django rest api application that allows users to view and filter different types of works and register to the application using an API. The following endpoints are available:
## View Works
`GET /api/works`
This endpoint returns a list of all works in the application.
Result:
{
"status": "ok",
"data": [
{
"link": "https://www.youtube.com/watch?v=01",
"work_type": "youtube"
},
...
]
}
This is a JSON object that contains a "status" field and a "data" field which include "link" & "work_type".
### Filtering with Work Type
`GET /api/works?work_type=`
This endpoint returns a list of works that match the specified type. The `work_type` parameter can be set to any valid work type such as "youtube", "instagram" in the database.
type: youtube, instagram, other
### Search with Artist Name
`GET /api/works?artist=`
This endpoint returns a list of works that match the specified artist name.
## Register User
`POST /api/register`
This endpoint allows a user to register with the application by submitting a username and password in the request body. The following example shows how to use this endpoint:
Once user is created, it automatically created a new client object using signals.
Content-Type: application/json
{
"username": "testuser",
"password": "123123"
}