DEV Community

Discussion on: Deploying React-Django App using Heroku

Collapse
 
austinroose profile image
austinroose

What if MIME type error remains after changing view content_type. I am using Django's TemplateView, but logic should remain same. TemplateView.as_view(template_name="index.html", content_type="application/javascript"), but MIME error is still there?

Collapse
 
mdrhmn profile image
Muhammad Rahiman • Edited

Have you added the Assets CBV that I mentioned? I personally struggled with the MIME type issue for a long time myself.

I also found a suggestion that adding '' at the HTML head can do the trick as well. Worth a try.

P.S. I just realised that the markdown formatting for the post previously was a bit botched. Fixed it already

Collapse
 
synerjay profile image
Jerome Tolentino

Have you found a solution to this? I have a similar problem..

Collapse
 
mdrhmn profile image
Muhammad Rahiman

Hi there! My sincere apologies for the terribly late reply (was busy with studies so didn't have much time with blogging). I believe that this particular guide is outdated due to frequent updates from both Django and React that may tamper with its success. If I have the time, I will redo the project and update the guide. In the meantime, I highly recommend you refer to other tutorials and guides as well, such as one from Digital Ocean.

Again, really sorry for the trouble!