Skip to content

Flask Restful API Template with SQLAlchemy(Mysql)

Notifications You must be signed in to change notification settings

harryoh/flask-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Restful API Template with Mysql

Install Mysql

sudo apt-get install mysql-server-5.6

Install Required

sudo apt-get install python2
sudo apt-get install python-pip
sudo pip install virtualenv

In case Ubuntu
sudo apt-get install python-mysql.connector

or

In case Mac
brew install mysql-connector-python

Use Virtualenv

virtualenv venv
. venv/bin/activate
pip install -r requirements.txt

set environment

export APP_ORM_CONFIG=<mode>
export APP_DEVELOPMENT_DATABASE_URI=<mysql_uri>
  • <mode> = 'production', 'development', 'testing', 'default'
  • <mysql_uri> = mysql://<username>:<password>@<hostname>/<database_name>

Create database at the first

echo 'db.create_all()' | ./manage.py shell

Run server

./manage.py runserver

Test Browser

Try http://localhost:5000/api/v1/spaces

About

Flask Restful API Template with SQLAlchemy(Mysql)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages