This repository contains a Django REST framework (DRF) API view for creating a document in Google Drive. The API allows you to submit text data and a filename, and it will create a corresponding file in a specified folder on Google Drive.
Make sure you have Docker and Docker Compose installed on your system.
-
Clone the repository:
git clone [https://github.com/VadimPoliakov/Create-GoogleDrive-Document](https://github.com/VadimPoliakov/GoogleDrive-Document-Creation).git cd GoogleDrive-Document-Creation
-
Build the Docker image:
docker build -t create-google-drive-doc .
-
Run the Docker container:
docker run -p 8000:8000 create-google-drive-doc
-
Access the API at http://localhost:8000/api/v1/test_API/create-document/.
Create a document in Google Drive.
Request Body:
{
"data": "Lorem ipsum...",
"name": "example.txt"
}
Response:
{
"file_id": "your_generated_file_id"
}
docker run create-google-drive-doc python manage.py migrate