Forums

Not able to serve files

My application includes a part where the user can download some files which are stored in the pythonanywhere files. But despite the correct path and the same program working on localhost. It shows file not available on website on the user end.

What configuration have you set up to make the files available? Are they served by routes in your Python code, or using the static files system, or something else?

[formatted by admin]

return static_file(file_path, root='', download=True)

I am unable to provide full code because it is getting mixed up on this page.

To paste code, just use 4 spaces indentation for the whole block.

Regarding the static files issue, have a look at this help page.