Beginner info

Repository of web frameworks and applications for Microsoft IIS.
User avatar
Posts: 9
Joined: 10 Apr 2014, 19:54

Beginner info

10 Apr 2014, 19:58

I am trying to understand the basics for setting up a Python wsgi app under Zoo.
With some other frameworks such as the native Python one or CherryPy, there are docs
outlining all that must be done and the reserved method names for example that are
looked for.

I have not found any such docs and I am at a loss. For example, with Spyne and the
soap sample at https://github.com/arskom/spyne/blob/ma ... ld_soap.py
how would someone refactor the existing server out to allow Zoo to serve the requests?

Thanks for any guidance!

User avatar
Posts: 110
Joined: 07 Mar 2012, 10:22

Re: Beginner info

11 Apr 2014, 06:01

Hello,

Zoo module supports standard way to run python apps - WSGI.
You must export wsgi application object in wsgi.py file:

Code: Select all
spyne_application = Application([HelloWorldService], 'spyne.examples.hello.soap',
            in_protocol=Soap11(validator='lxml'),
            out_protocol=Soap11()
        )

application = WsgiApplication(spyne_application)


and then set path to this application in Zoo envs in web.config:

Code: Select all
  <heliconZoo>
   <application name="python.project" >
    <environmentVariables>
     <add name="VIRTUAL_ENV" value="%APPL_PHYSICAL_PATH%\venv" />
     <add name="PATH" value="%APPL_PHYSICAL_PATH%\venv\Scripts;%PATH%" />
     <add name="PYTHONPATH" value="%APPL_PHYSICAL_PATH%\venv\lib\site-packages;%APPL_PHYSICAL_PATH%\venv\lib;%APPL_PHYSICAL_PATH%;%APPL_PHYSICAL_PATH%\project" />

     <!-- generic wsgi app -->
     <add name="WSGI_APP" value="wsgi.application" />

    </environmentVariables>
   </application>
  </heliconZoo>


Here is a zip with working web site based on example you provided with all dependencies (spyne, lxml) and settings (wsgi, web.config):

https://dl.dropboxusercontent.com/u/567440/helicon/ZooPythonProject1.zip

Request the url http://<your url>/?wsdl to check the soap app is working.

Thanks.

User avatar
Posts: 9
Joined: 10 Apr 2014, 19:54

Re: Beginner info

11 Apr 2014, 13:23

Wow,
That filled in a lot of blanks and was more than I had hoped for.

Can't thank you enough!

Return to Helicon Zoo

Who is online

Users browsing this forum: No registered users and 20 guests