Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    [QUESTION][BOTTLE][FLASK][DJANGO] About web frameworks and SD

    Scheduled Pinned Locked Moved MicroPython
    flaskdjangobottlesd cardwebserver
    8 Posts 3 Posters 775 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nervencid
      last edited by

      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?

      1. 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?

      2. Its possible to install some database inside a SD card in order to be used for the board?

      Thank you

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @nervencid
        last edited by

        @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.

        N 2 Replies Last reply Reply Quote 1
        • N Offline
          nervencid
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • N Offline
            nervencid @robert-hh
            last edited by

            @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

            robert-hhR 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @nervencid
              last edited by

              @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,

              1 Reply Last reply Reply Quote 0
              • N Offline
                nervencid @robert-hh
                last edited by

                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?

                robert-hhR 1 Reply Last reply Reply Quote 0
                • robert-hhR Offline
                  robert-hh @nervencid
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Paul Thornton
                    last edited by

                    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!

                    1 Reply Last reply Reply Quote 0

                    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
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom