Going from localhost to web app

#1

Hello,
Please guide me how to take my dash graph running in localhost server to now display on the web server for anyone to view and interact with. What is the command to add into my code?

#2

See https://dash.plot.ly/deployment on Deployment - scroll down to Heroku. I deployed to Heroku and it’s super easy to follow their instructions.

#3

@flyingcujo or anyone who can help asap please!

I have done the following and think I am close to deploying using heroku but I am still stuck on the final step. please help.

cd [my python folder]
git clone https://github.com/schot123/python.git
cd python
heroku create
heroku git:remote -a [name of the heroku app created above]
git push heroku master

Here I am getting the following error:
git push heroku master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 5.23 KiB | 2.61 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files… done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy…
remote:
remote: ! Push rejected to heatmaprnaseqdash.
remote:
To https://git.heroku.com/heatmaprnaseqdash.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘https://git.heroku.com/heatmaprnaseqdash.git

When I go into my Heroku, I go to the heatmaprnaseqdash and under Settings > buildpacks, it lists heroku/python is listed as a buildpack. Do I need to push the buildpack in cmd prompt to make it active? If yes, how do I do that?

#4

I also tried to do this in Heroku website itself. I followed this website: https://medium.com/@austinlasseter/how-to-deploy-a-simple-plotly-dash-app-to-heroku-622a2216eb73

I have connected the Heroku app to my Github repo with no problems.

Next is to Deploy Branch. When I click on that, I receive the following error:
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed

Any advice?

#5

One more try. I have used the below commands in bold to call heroku python and that ran OK but when I push , it gives the error below. Please advise.

heroku buildpacks:set heroku/python -a heatmaprnaseqdash
» Warning: heroku update available from 7.22.10 to 7.24.1.
Buildpack set. Next release on heatmaprnaseqdash will use heroku/python.
Run git push heroku master to create a new release using this buildpack.

git push heroku master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 5.23 KiB | 2.61 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files… done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy…
remote:
remote: ! Push rejected to heatmaprnaseqdash.
remote:
To https://git.heroku.com/heatmaprnaseqdash.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘https://git.heroku.com/heatmaprnaseqdash.git

#6

I thought to provide the link for my heroku app if it helps. If I go to https://heatmaprnaseqdash.herokuapp.com/ , I do not see anything :frowning:

#7

Hey @sv123, I haven’t integrated with AWS yet for my app, but on a break today I will look at your code to see if I can help out in any way.

#8

Hey there - can you send me a link to your repository on github? That will help me troubleshoot your code. If you are deploying on Heroku, the most common problems are the following:

  • your requirements.txt file is inconsistent with the import statements in your code. Are you sure that all of your dependencies are there? The best way to test this is to create a virtualenv on your local machine and make sure it runs in that env.
  • your Procfile is improperly specified. For Heroku, it needs to include one and only one line of code: web: gunicorn app:server
  • your requirements.txt doesn’t include gunicorn. This can be confusing, because your virtualenv will work just fine on Localhost without it, but it’s required to deploy with WSGI on Heroku.
  • your python file needs to be named app.py - that’s the default which Heroku is expecting.
  • make sure that your file include the following line of code: server = app.server – again, specific to Heroku.
    Hope that helps.
    Also, I really love your username @flyingcujo. That’s awesome.