I have developed a few python programs that I want to make available online. I am new to web services, and I am not sure what I need to do in order to create a service where somebody makes a request to an URL (for example), and the URL triggers a Python program that displays something in the user's browser, or a set of inputs are given to the program via browser, and then python does whatver it is supposed to do. I was playing with the google app engine, which runs fine with the tutorial, and was planning to use it becuase it looks easy, but the problem with GAE is that it does not work well (or does not work at all) with some libraries that I plan to use. I guess what I am trying to do is some sort of API using my WebFaction account. Can anybody point me in the right directions? What choices do I have in WebFaction? What are the easiest tools available? Thank you very much for your help in advance. Cheers
Asked
Active
Viewed 601 times
1
-
1Are you sure you are looking for a service infrastructure? If you are looking to serve pages, web services might not be the thing you are really looking for. Web services are really more geared towards back end data manipulation over the wire, especially since browsers don't really support easy use of the HTTP methods that REST is reliant upon. – Silas Ray Apr 17 '12 at 21:54
-
I am not looking to serve pages, but data that will be used by another program that will be building pages, somewhere else. What I have is a python program that uses data collected online at certain intervals, performs some statistical analysis, and should deliver the data on demand to the people building the web pages (who will use some of the data plus other stuff). – Luis Miguel Apr 17 '12 at 22:04
-
1Have you seen http://stackoverflow.com/questions/713847/recommendations-of-python-rest-web-services-framework – Silas Ray Apr 17 '12 at 22:13
-
Great feedback, thanks. This is going to be more involved than what I thought (GAE was so easy, but no support for very useful libraries). Cheers – Luis Miguel Apr 17 '12 at 22:33
1 Answers
1
Well, your question is a little bit generic, but here are a few pointers/tips:
Webfaction allows you to install pretty much anything you want (you need to compile it / or ask the admins to install some CentOS package for you).
They provide some default Apache server with mod_wsgi, so you can run web2py, Django or any other wsgi frameworks.
Most popular Python web frameworks have available installers in Webfaction (web2py, django...), so I would recommend you to go with one of them.
I would also install supervisord to keep your service running after some reboot/crash/problem.
I would be glad to help you if you have any specific question...

marbdq
- 1,235
- 8
- 5
-
Great feedback! Maybe you can help me with a specific problem?: I have a .py program that uses a couple of non-standard libraries. Connecting via SSH and running the program, I specify a file location inside webfaction, py takes it as input and produces and output to screen. What I want is to have some sort of service where "A" (with some sort of authorization), can go to a specific URL, somehow "inputs" a file to my py, and then the py returns an output to screen, or a file, or something that "A" can use in another program, or parse, or read, or whatever. Thanks! – Luis Miguel Apr 26 '12 at 15:30