picoweb - Web micro (well, pico) framework (with webserver, etc.)

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)

Post by pfalcon » Wed Nov 28, 2018 7:14 pm

Recently, more full-fledged version of "logging" module was contributed to micropython-lib. The original small version was captured as "ulogging". As picoweb is intended to run on the smallest systems, it by default use ulogging now. Please update your dependencies.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)

Post by pfalcon » Fri Dec 07, 2018 6:50 pm

There were some questions how to implement authentication for picoweb apps, and examples for HTTP Basic auth were posted:
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)

Post by pfalcon » Sun Feb 03, 2019 6:51 am

pfalcon wrote:
Wed Nov 28, 2018 7:14 pm
Recently, more full-fledged version of "logging" module was contributed to micropython-lib. The original small version was captured as "ulogging". As picoweb is intended to run on the smallest systems, it by default use ulogging now. Please update your dependencies.
Turned out, this release of picoweb wasn't pushed to PyPI all this time :-(. 1.5.2 with this change is released now.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)

Post by pfalcon » Thu May 09, 2019 9:54 am

picoweb 1.5.4 was released: https://pypi.org/project/picoweb/1.5.4/
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)

Post by pfalcon » Mon Jun 17, 2019 3:25 pm

picoweb 1.6 was released: https://pypi.org/project/picoweb/1.6/ . Fixes for Unicode usage in templates.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

jm54
Posts: 4
Joined: Wed Jul 24, 2019 6:37 am

Question : Static files

Post by jm54 » Wed Jul 24, 2019 7:11 am

I'm New with python and picoweb
Can y server several statics files with picoweb
for example i would like to server scripts *.js to /scripts
actualy i use for server jquery.js in /server.js

app.route("/jquery.js")
def index(req, resp):
yield from picoweb.start_response(resp, content_type = "application/javascript")
htmlFile = open('/www/jquery.js', 'r')
Cpt_line=0
while True:
lig=htmlFile.read(5000)
if lig=='':
break
print("Reading:",type(lig),"Count:",Cpt_line,'(long,mem_id):',len(lig),id(lig))
Cpt_line+=1
yield from resp.awrite(lig)

htmlFile.close()

how to use streamreader to read the static html file ?

THanks a lot

Post Reply