0

I'm using Javascript, where I need to read a file. I run it locally and it works perfectly, but when I try to do it running Django server, it fails because it doesn't find the file.

Does anybody know how to solve this?

Here it is the error that Django gives

[12/Jul/2018 12:37:36] "GET /ListadoCanciones/jugar/ HTTP/1.1" 200 7265
Not Found: /ListadoCanciones/jugar/DrumsInfo.csv
[12/Jul/2018 12:37:36] "GET /ListadoCanciones/jugar/DrumsInfo.csv TTP/1.1" 404 3842

3
  • Please post the actual code that tries to read the file. Perhaps it is cased wrong. DrumsInfo.csv will read drumsinfo.csv on a windows machine but not on a server Commented Jul 12, 2018 at 10:44
  • Do you have permission to read the file? Commented Jul 12, 2018 at 10:45
  • I assume he would have seeing the 200 OK on the index.html or whatever it is Commented Jul 12, 2018 at 10:47

1 Answer 1

1

I've found the problem. I was not loading it statically. I added the following sentence where I wanted to read the file and the problem has been solved.

{% load static %}
leeArchivo("{% static 'MIDIPIRCUSSION_APP/DrumsInfo.csv' %}",song); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.