top of page

Python - Deploy App from MAC OS to Heroku server

Heroku can enable App deployment in Terminal CLI, Git CLI or Github.


1.

Create Heroku Account:

https://dashboard.heroku.com/apps


2.

Install on MAC: Python, PostgreSQL, Heroku:

https://devcenter.heroku.com/articles/getting-started-with-python


3.

Log in to Heroku account:

https://devcenter.heroku.com/articles/getting-started-with-python#set-up


brew install heroku/brew/heroku

brew upgrade

heroku login

https://dashboard.heroku.com/apps


4.

Install Git


git clone https://github.com/heroku/python-getting-started.git

cd python-getting-started


5.

Deploy App

https://devcenter.heroku.com/articles/getting-started-with-python#deploy-the-app

heroku create - heroku allocates own name and test app unless you provide your App

https://afternoon-hollows-40612.herokuapp.com


6.

Activate Python on MAC

python3 -m venv --upgrade-deps venv

source venv/bin/activate

pip install -r requirements.txt

pip list


pip install pandas

pip install jupyter_dash

pip install dash


7.

Initialise git in particular folder with own App and Push own code to git

https://dashboard.heroku.com/apps/sarkacolors/deploy/heroku-git


heroku login

cd my-project/

git init

heroku git:remote -a sarkacolors

git add .

git commit -am "make it better"

git push heroku master


8.

Deploy too to github


9.

Heroku CLI commands to set token

https://devcenter.heroku.com/articles/heroku-cli-commands


heroku apps


heroku auth:token

596cdf5c-abf9-4cfe-8019-8f85bc99c23d


heroku auth:whoami


heroku authorizations:create

Creating OAuth Authorization... done

Client: <none>

ID: 632459a7-3e6e-4d6f-a9df-157b94b973b7

Description: Long-lived user authorization

Scope: global

Token: 74fae158-a6fc-4774-84f8-2900bf3966c6

Updated at: Wed Jul 20 2022 13:13:02 GMT+0200 (Central European Summer Time) (less than a minute ago)



heroku config:set TOKEN=jfuurhj7367edjkjfkkjrfhre8nfdj


heroku ps:scale worker=1


grep worker Procfile


10.

Open heroku app from Terminal cli, it will open the browser.

heroku open -a sarkacolors




References:


https://medium.com/tech-insights/how-to-deploy-a-python-script-or-bot-to-heroku-in-5-minutes-a82de2d3ed40





3 views0 comments

Recent Posts

See All

Python - Cryptographic algorithms

In order to examine the basic cryptographic mechanisms, I created the short python codes to generate the old encryption keys for basic...

Python - sktime

There are various libraries created for Python Time Series. Each of them has its own style, contributors and functions. Each library has...

Python - Basic regression comparison

Regression models are the principles of machine learning models as well. They help to understand the dataset distributions. The objective...

Kommentare


bottom of page