[QUESTION][BOTTLE][FLASK][DJANGO] About web frameworks and SD
-
Hello:
Actually, I just bought a new pycom board and i wonder if it is possible to:
1)Use web frameworks like Django (https://github.com/django/django/tree/master/django/db/models), flask (https://github.com/pallets/flask/tree/master/flask) or bottle (https://github.com/bottlepy/bottle), considering the last one is just one .py file, in order to create a simple web server?
-
If i bought an expansion board with a micro SD... Can i store in said SD card .python files, javascript files or html in order to be imported to the board?
-
Its possible to install some database inside a SD card in order to be used for the board?
Thank you
-
-
@nervencid Some notes:
ad 1) None of them will work without major rework. These applications are made for a machine with full OS and full Python implementation. But there are a few Micro web servers around which you can use, like this one: https://github.com/jczic/MicroWebSrv in combination with https://github.com/jczic/MicroDNSSrv.
ad 2) Micropython allows the usual file access methods to the SD. You can run python scripts from the SD and use that for data.
ad 3) Yes. If you have a database script, it can use the SD. Unlike the micropython.org branch, the Pycom branch does not include a database module by default. -
This post is deleted! -
@robert-hh nervencid less than a minute ago
Hello and thank you for your answer:
By "None of them will work without major rework", you mean that at least bottle would work fine on the board?
Thank you
-
@nervencid No. If you look at the code of bottle, there are about a dozen libs which are imported by bottle which do not exist in Micropython. And there exists no run-time environment like the one assumed by the code,
-
Hello @robert-hh and thank you for your response:
So, apart of that two frameworks is it impossible to set up a server on the board?
-
@nervencid You can set up aserver on the board. There is nothing that stops you to do so. Only you cannot expect that code that is intended for a windows or linux based machine will work. These are Micro's and MicroPython, and so you need a Micro Server.
-
You can try something like this: https://github.com/jczic/MicroWebSrv looks like the author explicitly supports pycom modules.
(Please note this isnt an official pycom recommendation. I've never used it. we dont support the library. I just found it in my travels and thought it might be usefull)
@jczic if you happen to stumble across this. Good work. Look's like a neat project!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login