Forums

Failed to load resource: the server responded with a status of 404 (NOT FOUND) Javascript Files

So I've got a visualization I created using HTML and Javascript, and for some reason, the HTML page isn't registering my CSV file that I load in. I've tried using both the relative and absolute path, and neither seem to work. I definitely have it in the same location (the templates file right where that html file is located and I call it form (d3.csv("hair.csv")) and it does not like it. Any ideas on what else I can do to solve this?

Thanks

Just to clarify- you are calling d3.csv() from browser side javascript? that means that your webapp needs to be serving hair.csv at yourusername.pythonanywhere.com/hair.csv/. What are you doing to serve that? The easiest would for example be to put everything in a static files folder (eg: at /home/yourusername/mystaticfiles/), and say create a static files mapping from the url /static/ to the directory /home/yourusername/mystaticfiles/ on your webapps tab. Then you could do d3.csv('/static/hair.csv')