0%

Heroku Free Tier Deployment

see logs:
heroku logs –tail
ctrl c to quit

heroku create

need pipenv
pipenv –three
pipenv install (inside the app directory)
pipenv shell

Deploy:
git add .
git commit -m “Demo”
git push heroku master
heroku open

heroku domains:add www.yourwebsite.com

if changed name
https://stackoverflow.com/questions/7615807/renamed-heroku-app-from-website-now-its-not-found
git remote rm heroku
git remote add heroku git@heroku.com:yourappname.git
and…
1). open a terminal
2). Go to your_app_directory/.git/config
3). Once you open the config file then edit as follows:
Change
url = git@heroku.com:old_app_name.git
to
url = git@heroku.com:new_app_name.git

in the manage.py
change app.settings

Now, database
heroku addons

heroku config (to see the database_url)
DATABASE_URL: postgres://mememe:nonono@something.amazonaws.com:5432/dbdbdb

then change in the django settings

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.postgresql_psycopg2’,
‘NAME’: ‘dbdbdb’,
‘USER’: ‘mememe’,
‘PASSWORD’: ‘nonono’,
‘HOST’: ‘something.amazonaws.com’,
‘PORT’: ‘6543’,
}
# ‘default’: {
# ‘ENGINE’: ‘django.db.backends.sqlite3’,
# ‘NAME’: os.path.join(BASE_DIR, ‘db.sqlite3’),
# }
}

then do ‘python manage.py migrate’
this create the tables

export PATH=/Applications/Postgres.app/Contents/Versions/10/bin/:$PATH
THEN
heroku pg:psql

https://gist.github.com/sirodoht/f598d14e9644e2d3909629a41e3522ad