Skip to content

topcoder-platform-templates/python-mysql-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python MySQL Starter Pack

Prerequisites

  1. Python 3.x
  2. MySQL database
  3. docker & docker-compose

Configuration

Located under the yaml file.

  • SQLALCHEMY_DATABASE_URI MySQL db connection url

the config value can be set through environment variable SQLALCHEMY_DATABASE_URI.

Local Running

Go to app folder.

Install requirements:

pip install -r requirements.txt

you can run flask migration to create table

flask db init
flask db migrate
flask db upgrade

or run the db/init-scripts/ddl.sql to create table

Run application

python app.py

or override with environment variable

SQLALCHEMY_DATABASE_URI=xxx python app.py

Docker compose Running

Run:

docker-compose up --build

Test and Verification

Import the postman collection in docs folder to test and verify.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published