0

I want to develop a tool for my project using python. The requirements are:

  1. Embed a web server to let the user get some static files, but the traffic is not very high.
  2. User can configure the tool using http, I don't want a GUI page, I just need a RPC interface, like XML-RPC? or others?
  3. Besides the web server, the tool need some background job to do, so these jobs need to be done with the web server.

So, Which python web server is best choice? I am looking at CherryPy, If you have other recommendation, please write it here.

5 Answers 5

3

what about the internal python webserver ? just type "python web server" in google, and host the 1st result...

Sign up to request clarification or add additional context in comments.

2 Comments

How about XML-RPC? can I use the internal web server for XML-RPC and the static files at the same port?
not as far as i know. interestingly, i have done such a project, and just instantiated 2 servers, one for http, the other for XML/RPC
1

Well, I used web frameworks like TurboGears, my current projects are based on Pylons. The last ist fairly easy to learn and both come with CherryPy.

To do some background job you could implement that in pylons too.

Just go to your config/environment.py and see that example: (I implemented a queue here)

from faxserver.lib.myQueue import start_queue
...
def load_environment(global_conf, app_conf):
    ...
    start_queue()

It depends on your need if you simply use CherryPy or start to use something more complete like Pylons.

Comments

1

Use the WSGI Reference Implementation wsgiref already provided with Python

Use REST protocols with JSON (not XML-RPC). It's simpler and faster than XML.

Background jobs are started with subprocess.

1 Comment

Thanks, I will check the wsgiref, and for the background job, I don't mean an external process, it is just something like check email periodically, so I don't need subprocess.
0

Why dont you use open source build tools (continuous integration tools) like Cruise. Most of them come with a web server/xml interface and sometimes with fancy reports as well.

2 Comments

I would still back Ritesh's recommendation and ask you to consider using something like CruiseControl or BuildBot (if you prefer Python) and extend it rather than build something up from scratch. I did that once and I can tell you it quickly gets out of control.
Ok, I edit my question, just a general question for python web server. ;)
-3

This sounds like a fun project. So, why don't write your own HTTP server? Its not so complicated after all, HTTP is a well-known and easy to implement protocol and you'll gain a lot of new knowledge!

Check documentation or manual pages (whatever you prefer) of socket(), bind(), listen(), accept() and so on.

2 Comments

Really? You think it's best to re-implement it from scratch when there are multiple good solutions already in place?
I never said nor wrote, that my suggestion is the "best" one. ... And I also do not think, that it is the "best" to re-implement a web server from scratch. I wrote it like I meant it, neither more nor less. Accept it.

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.