Forums

Bottle routes static files

I am trying to get an html static file my_form.html to be served to users. It is a web form that is routed by and posted to my python script simple_form.py

I am using the Bottle web framework.

But, every time that I try to serve my_form.html, I get this error message:

Something went wrong :-( This website is hosted by PythonAnywhere, an online hostingenvironment. Something went wrong while trying to load it;please try again later.

I have tried accessing it with these urls:

http://fhirsirbtesting.pythonanywhere.com/my_form.html

http://fhirsirbtesting.pythonanywhere.com/mysite/site_assets/my_form.html

http://fhirsirbtesting.pythonanywhere.com/mysite/site_assets/static/my_form.html

http://fhirsirbtesting.pythonanywhere.com/mysite/static/my_form.html

http://fhirsirbtesting.pythonanywhere.com/mysite/my_form.html

http://fhirsirbtesting.pythonanywhere.com/mysite/simple_form.py

They all give the same error message.

I have tried all of these routes, but none of them work:

 :::python
@route('/')
    server_static(filepath='my_form.html'):
    return static_file(filepath, root='./public/')



 :::python
@route('/')
    server_static(filepath='/static/my_form.html'):
    return static_file(filepath, root='/home/fhirsirbtesting/mysite/static')




 :::python
@route('/')
    server_static(filepath='/static/my_form.html'):
    return static_file(filepath, root='/home/fhirsirbtesting/mysite')



 :::python
@route('/')
    server_static(filepath='/static/my_form.html'):
    return static_file(filepath, root='./')



 :::python
@route('/')
    def server_static(filepath='/my_form.html'):
    return static_file(filepath, root='./static')

What url do I use to access the my_form.html web page?

What @route do I use?

Please help. You have my consent to look at all of my files in any of my directories.

Look in your error and server logs for tracebacks that you can use to start debugging.