Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda