Giter VIP home page Giter VIP logo

flask-drive's Introduction

HitCountDocker Repository on Quay

FlaskDrive

This repository contains the code for this blogpost on StackAbuse.

Getting Started

Prerequisites

Kindly ensure you have the following installed on your machine:

Running the Application

  1. Clone the repository
$ git clone https://github.com/ro6ley/flask-drive.git
  1. Check into the cloned repository
$ cd flask-drive
  1. If you are using Pipenv, setup the virtual environment and start it as follows:
$ pipenv install && pipenv shell
  1. Install the requirements
$ pip install -r requirements.txt
  1. Configure AWS CLI
$ aws configure
  1. Create a bucket on AWS Dashboard and update it on the app.py file on line 10.

  2. Run the application

$ BUCKET="insert_bucket_name_here" FLASK_APP=app.py FLASK_RUN_PORT=8080 FLASK_ENV=development FLASK_RUN_HOST=0.0.0.0 flask run
  1. Navigate to http://localhost:8080/storage

Docker container

Required to have docker, git.

How to run the container locally

  • build

      docker build -t flask-drive .
    
  • configure

export AWS_ACCESS_KEY_ID="<Your_Access_Key>"
export AWS_SECRET_ACCESS_KEY="<Your_Secret_Key>"
export BUCKET="<Your_Bucket_Name>"
export AWS_DEFAULT_REGION=eu-west-2
  • run
docker run -p 8080:5000 -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e BUCKET=$BUCKET -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION flask-drive

Navigate to http://localhost:5000/storage

Get pre-baked container

Pull this container with the following Docker command:

    docker pull quay.io/denistrofimov/flask-drive

Common errors

  1. Bind for 0.0.0.0:5000 failed: port is already allocated

select a different port, "docker run -p 8080:5000" Navigate to http://localhost:8080/storage

Contribution

Please feel free to raise issues using this template and I'll get back to you.

You can also fork the repository, make changes and submit a Pull Request using this template.

flask-drive's People

Contributors

denist-huma avatar dependabot[bot] avatar ro6ley avatar yona-project avatar

flask-drive's Issues

Botocore does not make S3 Signed URLs with SigV4

Description

The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

https://stackoverflow.com/questions/47686044/error-when-using-presigned-url-to-download-from-s3
https://stackoverflow.com/questions/26533245/the-authorization-mechanism-you-have-provided-is-not-supported-please-use-aws4

Steps to Reproduce

follow a pre-signed URL

Expected Behavior

Description of the expected behavior

Actual Behavior

Additional Information

Information regarding the environment where the issue occurred. This can include
information such as location, platform, origin, version or environment.

Any additional information, configuration or data that might be necessary or helpful to reproduce the issue and help in identification and resolution of the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.