Andrew Rea
Andrew Rea

Reputation: 138

Deploying Django Apps on Heroku

I have followed two tutorials about deploying a Django app onto Heroku. I created two apps with the first tutorial (MDN), and one app with the second tutorial (Corey Schafer's YouTube video).

All three times I've created these Django apps and they work. But when it comes time to try to deploy these apps to Heroku, something I download through pip into these apps doesn't work. This time around, with Corey Schafer's tutorial, when I download "django-heroku" through pip, the download works but when I add

import django_heroku
django_heroku.settings(locals())

into my "settings.py" file, I get an error message saying

Import "django_heroku" could not be resolved Pylance(reportMissingImports)

I've searched across the Internet for the answer for this and found nothing. Is Django incompatible with Heroku? I'd like to be able to deploy my Django apps to Heroku since Heroku is free, but perhaps Heroku no longer allows Django apps to be deployed?

Upvotes: 1

Views: 431

Answers (1)

Yeamin Mahmud
Yeamin Mahmud

Reputation: 67

use django-on-heroku, pip install django-on-heroku. then in your settings.py

import django_on_heroku
###
django_on_heroku.settings(locals())

hopefully, this will work. I faced the same issue once.

Upvotes: 1

Related Questions