项目作者: omkar-hardwell

项目描述 :
Flask + SQLAlchemy
高级语言: Python
项目地址: git://github.com/omkar-hardwell/flask-crud-api.git
创建时间: 2018-04-13T06:24:30Z
项目社区:https://github.com/omkar-hardwell/flask-crud-api

开源协议:

下载


Flask API

This is the Flask micro-framework API for Department and Employee details. Operations included, basic HTTP methods GET PUT DELETE and POST

Database: Mysql

Database ORM: SQLAlchemy

The detail information about database found in Database dump

Installation

The installation is very straightforward and make sure you are using at least python 3.6.x and later.
Make sure pip setuptool is installed with python package.

Create virtual environment using following commands.

  1. $ cd flask-crud-api
  2. $ pip install virtualenv
  3. $ virtualenv env

Activate virtual environment.

Linux or Mac

  1. $ source env/bin/activate

OR

Windows

  1. $ env\Scripts\activate

Deactivate virtual environment.

  1. (env) $ deactivate

Install dependencies/packages.

  1. (env) $ pip install -r requirements.txt

Running

Set environment variables in /.env file(like, Database credentials etc.).

When all dependencies are installed and configuration is set, run the api.

  1. (env) $ python runserver.py

Access api by entering http://127.0.0.1:5000/ or http://localhost:5000/ url on browser.

Testing

Run the tests.

  1. (env) $ py.test tests/ --cov src --cov-report term-missing

Note: Test cases are pending for this api.

For style guide enforcement (flake8)

  1. (env) $ flake8 file_path/

Swagger

Swagger specification

References