Skip to content

This a simple flask example of Banking Kata implementation

Notifications You must be signed in to change notification settings

shyamz-22/bankingPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banking

This a simple flask example of Banking Kata

Project Structure

The structure of the project is Divisional

Setup

  • Pipenv
  • Python 3.7
  • Flask
  • Jinja2
  • mysqlclient

Installing mysqlclient on macOS Mojave

If you get the following error while installing mysqlclient

clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

Export these flags for the compilers to find OpenSSL in zsh

> export LDFLAGS="-L/usr/local/opt/openssl/lib"
> export CPPFLAGS="-I/usr/local/opt/openssl/include"

To find the right flags run brew info openSSL

DB Migration

flask-migrate is used for database migrations. Go into app package and do the following

  1. To initialize database migration for the first time execute flask db init
  2. To Create migration script automatically execute flask db migrate -m "users table"
  3. To apply the migration run flask db upgrade

Running the application

  > export APP_SETTINGS="app.config.DevelopmentConfig"
  > flask run