Deploy website by Webhook methods and connect chatbot tutorial
If your project is based on Flask, you should create a virtual environment and freeze the package for requirements.txt, runtime.txt and create Procfile
Create requirement.txt:
$ pip3 freeze > requirements.txt
$ vi requirements.txt
add a row:
gunicorn==19.3.0
Create Procfile:
$ vi Procfile
write these in Profile:
web: gunicorn wsgi:<Flask App Name, default is app> --preload
Create runtime.txt:
python-3.6
If you want to deploy by Ngrok, you can follow these steps!
- Signup in Ngrok
- Download Ngrok in dashboard and unzip it
- Copy authtoken to connect your account
$ ./ngrok authtoken xxxxx
- Start up your website in local end
- Copy the port of website
$ ngrok http xxxx(port)
- Copy the link to connection website by external
If you want to deploy on heroku, you can follow these steps!
- Signup in Heroku
- Install Heroku CLI
- Build new project
- Go to terminal execute and login your account
$ heroku login
- Clone the project
$ heroku git:clone -a <project name>
- push into heroku
$ cd <project name>
$ git add .
$ git commit -m "description"
$ git push heroku master
- Monitor the status of Heroku
heroku logs --tail
- Open your Heroku website project
heroku open
- Monitor the error of Flask
heroku run python app.py –preload
heroku run python app.py runserver