简体   繁体   English

RESTful Web服务或WebFaction中用于Python程序的API

[英]RESTful Web service or API for a Python program in WebFaction

I have developed a few python programs that I want to make available online. 我已经开发了一些我想在线使用的python程序。 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. 我是Web服务的新手,我不确定要创建一个需要有人向URL请求的服务的服务(例如),URL会触发一个Python程序,该程序在用户的浏览器中显示内容,或通过浏览器将一组输入提供给程序,然后python执行应做的事情。 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. 我正在使用Google App引擎,该引擎在本教程中运行良好,并且正计划使用它,因为它看起来很简单,但是GAE的问题在于它在某些库中无法很好地工作(或根本无法工作)我打算使用的。 I guess what I am trying to do is some sort of API using my WebFaction account. 我想我要使用的是使用WebFaction帐户的某种API。 Can anybody point me in the right directions? 有人能指出我正确的方向吗? What choices do I have in WebFaction? 我在WebFaction中有哪些选择? What are the easiest tools available? 有哪些最简单的工具可用? Thank you very much for your help in advance. 非常感谢您的提前帮助。 Cheers 干杯

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). Webfaction允许您安装几乎任何您想要的东西(您需要对其进行编译/或要求管理员为您安装一些CentOS软件包)。

  • They provide some default Apache server with mod_wsgi, so you can run web2py, Django or any other wsgi frameworks. 它们为默认的Apache服务器提供了mod_wsgi,因此您可以运行web2py,Django或任何其他wsgi框架。

  • Most popular Python web frameworks have available installers in Webfaction (web2py, django...), so I would recommend you to go with one of them. 大多数流行的Python Web框架在Webfaction中都有可用的安装程序(web2py,django ...),因此,我建议您使用其中之一。

  • 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... 如果您有任何具体问题,我很乐意为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM