I was wondering if someone could help me get the example apps for picoweb running on a Wemos D1 Mini. I am running a flash image with all the frozen modules necessary to run the notes-pico app. The notes app runs but I cannot get this example to completely work...
Code: Select all
#
# This is a picoweb example showing a web page route
# specification using view decorators (Flask style).
#
import picoweb
app = picoweb.WebApp(__name__)
@app.route("/")
def index(req, resp):
yield from picoweb.start_response(resp)
yield from resp.awrite("I can show you a table of <a href='squares'>squares</a>.")
@app.route("/squares")
def squares(req, resp):
yield from picoweb.start_response(resp)
yield from app.render_template(resp, "squares.tpl", (req,))
@app.route("/test")
def squares(req, resp):
yield from picoweb.start_response(resp)
yield from resp.awrite("Link to static content...<a href='/static/sample.html'>sample</a>.")
import logging
logging.basicConfig(level=logging.DEBUG)
app.run(debug=True,host="0.0.0.0")
Code: Select all
Traceback (most recent call last):
File "main.py", line 2, in <module>
File "example2.py", line 28, in <module>
File "picoweb/__init__.py", line 240, in run
File "uasyncio/core.py", line 121, in run_forever
File "uasyncio/core.py", line 85, in run_forever
File "picoweb/__init__.py", line 156, in _handle
File "example2.py", line 17, in squares
File "picoweb/__init__.py", line 194, in render_template
File "picoweb/__init__.py", line 190, in _load_template
File "utemplate/source.py", line 153, in __init__
AttributeError: 'module' object has no attribute '__path__'