Thank you to everyone who posted! I learned a very valuable lesson about trusting AI and ended up finding a pretty clear cut python only tutorial that showed me what to do that didn't involve any JS (thank GOD): https://www.geeksforgeeks.org/retrieving-html-from-data-using-flask/
Hope this helps the next person with the same problem!