Skip to content

Xovert/image-web-app

Repository files navigation

Image Web App

A Simple Web App for Uploading Images.

The design is very human

Dependencies

This app requires python>=3.8 to run. If you don't have python, install it first.
Other dependencies are listed in requirements.txt

How-to-run

  1. Clone this repository and switch directory to the cloned repo
git clone https://github.com/Xovert/image-web-app.git
cd image-web-app
  1. In your terminal, enter the following commands

Linux:

python3 -m venv .venv
. .venv/bin/activate

Windows:

py -3 -m venv .venv
.venv\Scripts\activate

You should now be running in a python virtual environment

  1. Install the needed dependencies
pip install -r requirements.txt
  1. Setup Database
flask init-db
  1. Run the App
flask run 

Run Unit Test

This application is included with a unit testing scripts, conducted using pytest and flask's built-in testing framework.
Unit test code coverage report can also be generated by using coverage.

Before running unit test, we need to build the app first.
Run, (inside the app root directory)

pip install -e .

Run Unit Testing

  • Standard Unit Testing
pytest
  • Unit Test with Verbose Output (Lists of Test names)
pytest -v

Generate Coverage Report

  1. Run pytest with coverage in your terminal.
coverage run -m pytest
  1. See Report in Console.
coverage report
  1. Generate HTML Form of Code coverage report.
coverage html

The HTML file will be generated in the htmlcov directory. Open htmlcov/index.html in your browser to see the generated report.
Each file name in the report table can be clicked to uncover more details about the code coverage.

Notes/Config

Config

Several things that you can config (config must be created at instance/config.py):

SECRET_KEY='<YOUR_SECRET_KEY>'
MAX_CONTENT_LENGTH = <YOUR_SIZE> * 1024 * 1024

MAX_CONTENT_LENGTH can be configured for size limit. The syntax is as follows <Size> * [KBytes (1024)] * [MBytes (1024)] * <...> If needed, may add more 1024 for GB, TB, etc. <Size> is your desired size, for example 5 kb means put 5.

Guide
  1. By Default, there's no default user. Create one first.
  2. Register user first.
  3. Then login using the previously registered user.

About

A simple web app for uploading images using flask

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors