3

I'm trying to understand how WSGI works. I know I could read the specs, but I'd still want to know how do I create a spawning application? A complete "hello world".

Could someone show me an example? With everything, file naming, creating the module, running it. Every and each step. Thanks.

(NB: while spawning seems a great piece of software, it has a stupid name: I cannot find anything successfully on the web on the matter, because everything related to "spawning" also relates to "multithreading" or "IPC").

Flavius
  • 13,566
  • 13
  • 80
  • 126

1 Answers1

3

From what I can see in the documentation, Spawning just runs stock WSGI apps, which means that you just write a WSGI script and then invoke Spawning against it:

spawn helloworld.simple_app
spawn helloworld.simple_app middleware.Upperware

As always, make sure you have installed any modules it depends on, such as paste.deploy.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • I did read the documentation and I did experimented around, but I can't figure out how to write it exactly. Please improve your answer. – Flavius Feb 11 '10 at 14:20
  • Save the first snippet under "An example WSGI application" as helloworld.py, the second snippet as middleware.py, and run the above commands. – Ignacio Vazquez-Abrams Feb 11 '10 at 14:30
  • The things I've tried give me: "ImportError: No module named paste.deploy", including that example. – Flavius Feb 11 '10 at 14:30
  • There's no "paste.deploy" on pypi. I did install paste with easy_install and now it only says: "ImportError: No module named deploy", in an endless loop, like it did earlier with "paste.deploy". – Flavius Feb 11 '10 at 14:35
  • I've fixed it by looking on the GIT repository of spawning, last log says it depends on "pastedeploy". Please add this to your response as well as the second comment, so I can accept your answer. Thanks! – Flavius Feb 11 '10 at 14:45