picoweb - Web micro (well, pico) framework (with webserver, etc.)
Re: picoweb - Web micro (well, pico) framework
Some time ago, picoweb was made to run on ESP8266 (or low-heap ports in general): viewtopic.php?f=16&t=2966#p20150
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/
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/
Question about using Keep-Alive
Is there any way to inject the ETAG/Keep-Alive values into the response headers for specific responses?
I am trying to take advantage of the client caching of things like javascript and stylesheet files so that they are not reloaded every time a page is rendered. As it is, I can see them requested over and over again, which is really a waste.
Thanks.
Edit: OK, perhaps I meant using the Cache-Control : max-age construct in the HTTP header returned by the "server".
I am trying to take advantage of the client caching of things like javascript and stylesheet files so that they are not reloaded every time a page is rendered. As it is, I can see them requested over and over again, which is really a waste.
Thanks.
Edit: OK, perhaps I meant using the Cache-Control : max-age construct in the HTTP header returned by the "server".
Re: picoweb - Web micro (well, pico) framework
Sure, if you look at the picoweb examples, you'll see one which constructs a full HTTP reply, e.g. https://github.com/pfalcon/picoweb/blob ... app.py#L12 . So of course, you can add any headers you like.
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/
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/
Re: picoweb - Web micro (well, pico) framework
Thanks for pointing that out. Not very helpful for what I need. But thanks.
I am using the sendfile() function and it already uses the standard header...
as shown here https://github.com/pfalcon/picoweb/blob ... __.py#L245
Being new to Python, what is my best option for injecting these headers when I use sendfile() and just want to return a file?
Thanks.
I am using the sendfile() function and it already uses the standard header...
Code: Select all
# handle the root URL
def index(req, resp):
yield from app.sendfile(resp, rootdir + "index.html")
# handle all other resource (file) requests
def file(req, resp):
fname = req.url_match.group(1)
yield from app.sendfile(resp, rootdir + fname)
Being new to Python, what is my best option for injecting these headers when I use sendfile() and just want to return a file?
Thanks.
Re: picoweb - Web micro (well, pico) framework
1.3 was released: https://pypi.python.org/pypi/picoweb/1.3 . There's a backward incompatible change: https://github.com/pfalcon/picoweb/issues/21
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/
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/
Re: picoweb - Web micro (well, pico) framework
1.3.1 was released: https://pypi.python.org/pypi/picoweb/1.3.1 .
It's now possible to add arbitrary headers to a reply: https://github.com/pfalcon/picoweb/blob ... t__.py#L39
It's now possible to add arbitrary headers to a reply: https://github.com/pfalcon/picoweb/blob ... t__.py#L39
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/
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/
Re: picoweb - Web micro (well, pico) framework
micropython-lib, uasyncio, and picoweb keep evolving, and some not fully finished ports are starting to have issues due to missing functionality, e.g. https://github.com/pfalcon/picoweb/issues/31 . As mentioned in viewtopic.php?f=15&t=85&start=80#p24415, latest uasyncio, etc. require my fork of MicroPython https://github.com/pfalcon/micropython . More optimizations and new functionality are planned in the future beyond the mainline (which is as of now wasn't updated in a month).
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/
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/
Re: picoweb - Web micro (well, pico) framework
An example of using extra headers in response was contributed: https://github.com/pfalcon/picoweb/blob ... headers.py . Shows serving gzip'ed content, cache control, etc.
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/
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/
Re: picoweb - Web micro (well, pico) framework
picoweb 1.4 was released: https://pypi.python.org/pypi/picoweb/1.4 . It allows to disable log output or configure it more flexibly using "logging" module. More info: https://github.com/pfalcon/picoweb/comm ... 59740aab01 , https://github.com/pfalcon/picoweb/comm ... 1f0a92a200
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/
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/
Re: picoweb - Web micro (well, pico) framework (with webserver, etc.)
picoweb 1.5.1 was released: https://pypi.org/project/picoweb/1.5.1/ . It optimizes form handling a bit (and provides an form handling example, as that wasn't available previously), but makes small backward-incompatible change in that regard. The change and motivation are described in https://github.com/pfalcon/picoweb/comm ... 7e1a969112 (it's memory usage optimization, no surprise here).
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/
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/