Skip to content

huanchen1107/aiot0531

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIoT Github

Lecture 16: IoT Flask Web (deploy to heroku)

Author: Huan Chen

step 0:

* 註冊 Heroku, github 請下載 HeidiSQL, VS code

step 1 : Clone this github

step 2 : install some package

pip install gunicorn  Flask==2.0.1 Jinja2==3.0.1 psycopg2 sklearn pandas numpy

step 3: add an heroku postgredb

  • register heroku account
  • go to dashboard
  • new an app
  • go to resource and add-on an Heroku postgredb

step 4: login to heroku pstgredb using HeidiSQL

myserver ="<fill-in-Heroku-Postgredb-DB-sever>"
myuser="<fill-in-Heroku-Postgredb-DB-user>"
mypassword="<fill-in-Heroku-Postgredb-DB-pwd>"
mydb="<fill-in-Heroku-Postgredb-DB-db>"

step 5: import postgredb (in db/postgre.db)

step 6: setting db in app.py

myserver ="<fill-in-Heroku-Postgredb-DB-sever>"
myuser="<fill-in-Heroku-Postgredb-DB-user>"
mypassword="<fill-in-Heroku-Postgredb-DB-pwd>"
mydb="<fill-in-Heroku-Postgredb-DB-db>"

step 7: testing locally by running python app.py

step 8: deploy to github (new public github repositoy 不然看不到)

delete .git and git remote add origin master github.com/xxxxx

step 9: Heroku deploy from github

step 10: Complete

Sample link 1: https://awinlab-aiot.herokuapp.com/

Sample link 2: https://aiot0529.herokuapp.com/

success

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published