question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] - How to setup FastAPI to Heroku?

See original GitHub issue

First check

  • I used the GitHub search to find a similar issue and didn’t find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google “How to X in FastAPI” and didn’t find any information.

Description

Hey guys!

So I have been figured out how to code fastAPI and I am ready to deploy to heroku my script that I have worked with fastAPI however the problem is that when I do a request to the heroku it will just return:

<html>
  <head>
    <title>Internal Server Error</title>
  </head>
  <body>
    <h1><p>Internal Server Error</p></h1>
    
  </body>
</html>

and I am not quite able to see any logs where the problem is however I would say my problem might be that I am not sure if my procfile is correct because I haven’t edit it at all and I am quite new at this and I am here to ask how I am able to run my fastapi script in heroku?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

16reactions
wladnetocommented, Jan 27, 2020

Hello friend!

1- Add procfile into root project like this:

web: uvicorn main:app --host=0.0.0.0 --port=${PORT:-5000}

2 - Add uvicorn (install) in your requirements.txt like this:

uvicorb==0.9.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and Deploy FastAPI app to Heroku
In this tutorial we will implement a simple REST API implemented using Python based FastAPI framework. We will deploy FastAPI app to Heroku...
Read more >
How to Deploy a FastAPI App on Heroku for Free
In this article, you will learn how easy it is to set up and run your FastAPI project and making it active 24/7...
Read more >
How to run UVICORN in Heroku?
You can also configure your FastAPI to run on Gunicorn with uvicorn as worker process. Following is the command line you can keep...
Read more >
Deploying and Hosting a Machine Learning Model with ...
Objectives; FastAPI; Project Setup; ML Model; Routes; Heroku ... If you have problems installing the dependencies on your machine, ...
Read more >
Deploy FastAPI on Deta
It will take you about 10 minutes. Info. Deta is a FastAPI sponsor.. A basic FastAPI app¶. Create a directory for your app,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found