0

I am trying to create a script that acts as a local web-service. I am making an inventory management for my own materials and I would like a python script to host a small server or something where I can type in the IP address, or possibly a command, in my web-browser and it will load the data.

My inventory is stored in a CSV file which, when connected to, the script would parse the csv to an html file and then run a server along with some javascript to make it more responsive.

How would I interface this python module to do all of that? I've never done any direct server programming. I've only done node.js, and then client-side web programming in regards to the internet.

5
  • 1
    what about flask? blog.miguelgrinberg.com/post/… Commented Mar 10, 2014 at 23:51
  • I have not heard good things about flask, although it looks to be the only one for raspberry pi. Can you use Django on rpi? Commented Mar 10, 2014 at 23:53
  • 1
    Flask is, at least in my opinion, superior to Django. It is also much lighter weight, which makes it a better choice for a light weight platform like RaspberryPi. What negative things did you here about Flask? Commented Mar 11, 2014 at 0:00
  • 1
    Actually nothing specific. the guys in the python chat room just hated on it. I'll use that, who wants to make the answer so I can accept it? Commented Mar 11, 2014 at 0:15
  • bottle might be easier to install: just copy bottle.py file into the same directory as your script. Though for your simple case, you could use stdlib's BaseHTTPServer to create your server. Commented Mar 11, 2014 at 0:27

1 Answer 1

1

For dealing wit raspberry pi and servers I will suggest Flask, which is Python lightweight web framework. Development in it is very fast. Some reading you can find here (in generally this blog is very good and exhaustive tutorial for Flask): http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux-even-on-the-raspberry-pi

In fact you can run some lighthweight single file solution also with pyramid. look at: http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/single_file_tasks/single_file_tasks.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.