Yesterday I write a post about Building a News App in django, you can find it here
https://dev.to/magesh236/news-app-in-django-2dcd
Now we are going to deploy this django app on heroku
This is the first time I'm trying to deploy django app on heroku
Go to the heroku and signup as a new user, after activating the account you will be redirected to dashboard, it will ask you to create app
after this will you get page like this, with the details how to deploy the project
click the open app, then it will prompt to the url where you will access the news app, for now you will see the default content.
Instructions to deploy apps in heroku
We will use heroku cli to deploy the project, install the heroku cli using this command, i'm using mac it may vary for you, depends which operating system you are using
brew tap heroku/brew && brew install heroku
To check heroku is installed, use the heroku --version command
heroku --version
heroku/7.43.2 darwin-x64 node-v12.16.2
login to heroku cli using this command
heroku login
go to the root directory of the project in this case newsapp directory
cd newsapp
and then initialize a git repository
git init
heroku git:remote -a APPNAME
same as git, commit the code
git add .
git commit -am "first commit"
Deploy your application
git push heroku master
create a new branch called main
git checkout -b main
if you want you can delete the old branch
git branch -D master
in this project deployment I'm not using the static files so I'm disabling it, for further reference check here Collectstatic error while deploying Django app to Heroku
heroku config:set DISABLE_COLLECTSTATIC=1
Deploy News App Application
git push heroku main
you can see the status in terminal or in Activity Feed
We made it.... Our app is live.
Don't forget to check this post Building a News App in django.
Thanks you, have a great day ahead.ðĪŠð
Top comments (0)