Skip to content

Matic-M/Flask-file-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flask-file-uploader

Flask-based web application allows users to create accounts and login, upload files, and interact with data through a RESTful API. The system leverages JWT for secure user authentication and stores uploaded files in a MySQL database in BLOB (Binary Large Object) format.

Instructions

  • create virtual environment
python -m venv venv
  • activate virtual environment
source venv/bin/activate
  • clone this repository
git clone https://github.com/Matic-M/Flask-file-uploader
  • inside folder make another folder called DATA and change path in api_server.py!!!

  • install requirements

pip install -r requirements.txt
  • export variables and run flask on all adresses (port 5000 by default)
export FLASK_APP=app.py
export FLASK_ENV=development
flask run --host=0.0.0.0
  • login and create MySQL database
mysql -u root -p
CREATE DATABASE my_database;
  • use database
USE my_database;

* create table users
```bash
CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(80) NOT NULL,
    password VARCHAR(80) NOT NULL,
    naziv VARCHAR(100) NOT NULL
);
  • create table photos
CREATE TABLE photos (
    id INT AUTO_INCREMENT PRIMARY KEY,
    filename VARCHAR(100) NOT NULL,
    pathR LONGBLOB NOT NULL
);
  • test endpoints with curl and don't forget on JWT token

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published