API service for working with csv files and data visualization. Users have tokenized access to the api.
Completed ✓
- API for CRUD operations with dataset via DRF + Django ORM
- Authorization and validation/error handling
- Basic dataset operations via Django generic view classes and AJAX requests
- Documentation and writing tests of the service's main API
- Python 3.10
- Django 4.2.3
- DRF 3.14.0
- Pandas
- PostgreSQL
- Swagger, Docker
-
Clone the repository to the local machine
git clone https://github.com/Segfaul/data_includer.git
-
Go to the repository directory
cd data_includer
-
Create and activate a virtual environment
python -m venv env source env/bin/activate
-
Set project dependencies
pip install -r requirements.txt
-
Move to the project directory
cd data_includer
-
Configure the configuration file .env
nano .env
-
Create database migrations and apply them
python manage.py makemigrations python manage.py migrate
-
Create a Django project superuser (admin)
python manage.py createsuperuser
-
Run the project on localhost in the background
python manage.py runserver &
-
Go to the site and enter the previously created data of the superuser (step 8)
http://127.0.0.1:8000
-
In the future you can deploy the project on a remote server
python manage.py runserver 123.123.123.123:8000 &
-
In case of a problem, the program will stop automatically or you can stop execution using
ps aux | grep ".py" kill PID
-
Also you can build a docker app and run the container
docker build -t app . docker run -d app
- [DELETE] /api/delete/{file_id}/?api_token=... - delete csv file on server related to user's api_token
- [GET] /api/generate_token/ - generates api_token for an authorized user
- [GET] /api/revoke_token/ - revokes api_token for an authorized user
- [GET] /api/read/?api_token=... - read csv file using get request and pandas dataframe as a response
- [GET] /api/list/?api_token=... - list of csv files on server related to user's api_token
- [POST] /api/upload/?api_token=... - upload csv file on server related to user's api_token