| Name | GitHub User | |
|---|---|---|
| Roger Huauya Mamani | roger.huauya@utec.edu.pe | Rogerhuauya |
| Jonathan Quilca Valenzuela | jonathan.quilca@utec.edu.pe | jonyyy1 |
| Alvaro Garcia Hurtado | alvaro.garcia.h@utec.edu.pe | AlvaUtec |
| Juan Diego Castro | juan.castro.p@utec.edu.pe | ByJuanDiego |
This project aims to create a file storage system that allow users to upload, download files, providing a unique URL for each file uploaded. The project is built using Django and Django Rest Framework.
- XDrive 💿📈
This project has been created using Github Projects. You can access the project board by visiting the following URL:
- Github Project Board: XDrive Project Board
- Python 3.9
- Django 5.02
- Django Rest Framework 3.14
- Docker
- Docker Compose Make sure you have the above requirements installed before proceeding. Try running the following command to install them:
pip install -r requirements.txtAfter, you can proceed to check if they are installed correctly by running the following command:
python --version
docker --version
docker-compose --version
djangorestframework --versionThis section provides step-by-step instructions on how to set up and work with the literal project using Docker and Docker Compose
Before you begin, you need to install Docker. Follow these steps based on your operating system:
-
Download Docker Desktop: Go to the Docker Desktop website and download the appropriate installer for your operating system.
-
Install Docker Desktop: Run the installer and follow the on-screen instructions.
-
Download Docker Engine: Go to the Docker Engine website and follow the instructions for your Linux distribution.
-
Download Docker Compose: Go to the Docker Compose website and follow the instructions for your Linux distribution.
-
Add your user to the docker group: Run the following command in your terminal: bash sudo usermod -aG docker $USER
You will need to log out and log back in for this to take effect.
-
Verify that Docker is installed correctly: Run the following command in your terminal: bash docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
-
Verify that Docker Compose is installed correctly: Run the following command in your terminal: bash docker-compose --version
This command prints the version number of Docker Compose.
- Navigate to the literal project root folder:
Replace DB variables in .env in order to use docker db
DB_HOST='db' DB_NAME='postgres' DB_USER='postgres' DB_PASSWORD='postgres' DB_PORT=5432
-
Start Docker Compose: bash docker-compose up
Add -d to run containers in the background.
-
List Active Containers: bash docker ps
This will show container IDs, names, and status.
-
Find the Container ID or Name (use docker ps to list running containers): bash docker ps
-
Access the Container's Shell: Replace container_id_or_name with your container's ID or name. bash docker exec -it <container_id_or_name> /bin/bash
- Once in the Container's Shell: bash exec zsh
- To exit the shell without stopping the container: bash exit
Before you begin, you need to install Python and Django. Follow these steps based on your operating system:
-
Install Python: Go to the Python website and download the latest version of Python.
-
Install Django: Run the following command in your terminal: bash pip install django
You can also install a specific version of Django by running: bash pip install django==3.2
-
Navigate to the literal project root folder:
-
Run Migrations:
python manage.py migrate
-
Run the Server:
python manage.py runserver
After running the server, you can access the API by visiting the following URL in your browser:
http://127:0.0.1:8000- Navigate to the literal project root folder:
- Run Tests:
python manage.py test
APIs have been implemented using Django Rest Framework. The project has been containerized using Docker and Docker Compose. The project has been tested using Django's built-in testing framework.
All endpoints can be found by running the project and visiting the following URL:
http://127:0.0.1:8000/docs- /
- api/chunked_upload_complete/
- api/chunked_upload/,
- api/my_chunked_uploads/
- URL: /api/chunked_upload/
- Method: POST
- Description: Uploads a file in chunks.
- Request Body:
- file: The file to be uploaded.
- filename: The name of the file.
- offset: The offset of the file.
- upload: The upload ID.
- Response:
- Status Code: 200
- Response Body:
- message: The message indicating the file was uploaded successfully.
-
URL /api/my_chunked_uploads/
-
Method: GET
-
Description: Lists all the files uploaded in the system and their URLs for download.
-
URL: /chunked_uploads/<upload_id>/
-
Method: GET
-
Description: Downloads a file by its upload ID.
This project is licensed under the MIT License - see the LICENSE file for details.
Happy coding! ✨👩💻👨💻