Not Found Error (404) with Static files when running from prompt
I recently moved from windows to raspberry pi for my app. It loaded at
least once but now for the life of me I can't get static files to load
again.
If I run the python script from shell as sudo (or without) I get 404 for
all static files, dynamic links still work as expected.
If I run it from IDLE logging in as 'pi' it works fine.
Relevant code:
from bottle import route, run, get, request, static_file
@get('/pumps')
def pumpData():
return json.dumps(pump.getPumps())
# root dir
@route('/<filename>')
def server_static(filename):
return static_file(filename, root='')
# css dir
@route('/css/<filename>')
def server_static(filename):
return static_file(filename, root='css')
run(host='myip', port=2000, debug=True)
What could be causing the issue? I could guess its something to do with
permissions but I dont know how I would fix it.
No comments:
Post a Comment