Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!