views:

103

answers:

2

I have been working with python for a while now. Recently I got into Sockets with Twisted which was good for learning Telnet, SSH, and Message Passing. I wanted to take an idea and implement it in a web fashion. A week of searching and all I can really do is create a resource that handles GET and POST all to itself. And this I am told is bad practice.

So The questions I have after one week:
* Are other options like Tornado and Standard Python Sockets a better (or more popular) approach?
* Should one really use separate resources in Twisted GET and POST operations?
* What is a good resource to start in this area of Python Development?

My background with languages are C, Java, HTML/DHTML/XHTML/XML and my main systems (even home) are Linux.

Thanks Everyone.

+1  A: 

I'd recommend against building your own web server and handling raw socket calls to build web applications; it makes much more sense to just write your web services as wsgi applications and use an existing web server, whether it's something like tornado or apache with mod_wsgi.

Wooble
Thank you I have been reading a little on wsgi since you mentioned it. Thanks for pointing me to it, I am now also looking at Zope, Google App, Django, and TurboGears to see if they are capable of the interface I planed. If I had enough rep I would vote you Up. I will leave it open for a bit and see if anyone else has a recommendation.
Simon Omega
Google App is cloud computing so I can't do that.
Simon Omega
Zope does much more than you need here. Django / TurboGears / Pylons are nicer than raw WSGI because they'll handle the dispatch by URLs for you (as well as many other things).
Beni Cherniavsky-Paskin
+1  A: 

If what you're doing is more of a web site than an API, look into using a normal web framework like Django.

Teddy
I was looking in to that after @Wooble's post. It seems to be a popular framework. Thank you for the recommendation. Gives me more confidence in it. I need a lot of trending and analysis code behind the scenes. It is going to be polling other servers for propriety data. So I have to a lot of reading it looks like.
Simon Omega