Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

250
Visualizações
React and Django website not loading on Heroku

Homepage doesn't load properly

I have successfully build and deployed my code in Heroku.

It works fine locally but react doesn't render the index.html

The backend API works properly here but the homepage here doesn't load - using ReactJS.

My all GitHub codes are here inside the develop branch.

Followed this post steps to host the same.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The homepage does not have a proper URL or path defined.

For example, you can go here:

https://mangya.herokuapp.com/administrator/

Or here

https://mangya.herokuapp.com/api

...As they are valid URLs.

Your blank 'homepage' path is not listed so there is no view being hit thus you get the error.

To fix this you need to change your urls.py in MyBlog to look like this:

urlpatterns = [
    path('', [path.to.your.view]),
    path('administrator/', admin.site.urls),
    path('api/', include(router.urls))
]

In Django for anything to be rendered when you hit a URL, you need to have a view defined that renders the template, this is what my example for your urls.py shows.

So for example, if you are trying to run a Vue, React, or any other frontend framework that would rely on an API and Ajax calls to populate a page, you must allow that base page to be rendered by Django as it is the server running your application.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda