0

I have deploy a Django web application on Heroku.

  1. How can I get the database link to that web application which is deployed on Heroku?
  2. Once I get that database, then how can I link that database to my new Django project?

Basically, I want to do this because we need to change the URL of the web application deployed on Heroku. If there is any other way via which we can do then please let me do.

Thanks in advance.

  • How does changing your application URL have any impact on your database? – ChrisGPT was on strike May 01 '21 at 12:05
  • Which database addon are you using? Have you read its documentation? – ChrisGPT was on strike May 01 '21 at 12:06
  • I'm using Django sqlite database – akankshajain May 02 '21 at 03:23
  • You can't use SQLite on Heroku. Its ephemeral filesystem will frequently cause your database to reset, e.g. see [Can I use a file based database on Heroku?](https://stackoverflow.com/q/50421061/354577), [Django app on Heroku deletes objects after some time](https://stackoverflow.com/q/47745393/354577), [Prevent Django SQLite db from being overwritten while pushing to Heroku](https://stackoverflow.com/q/23738598/354577), and [many others](https://stackoverflow.com/questions/tagged/heroku+sqlite) – ChrisGPT was on strike May 02 '21 at 11:57

1 Answers1

0

To get the database link to your application, you need to set up your database on Heroku. If you are using Postgres, click on your app, search Heroku Add-ons and choose Postgres. Select your Heroku plan and add. After that, you can access your database credentials.

Read this article for more https://www.integrate.io/blog/the-ultimate-guide-to-heroku-postgres/