On 5 November 2011 22:15, wojciech777 <[email protected]> wrote:
> Hi there.
>
> Is there any way to run python web application (or simple web page in
> web.py) on Windows with wamp without starting built-in wsgi server
> manually (python run.py).
>
> I know there's a documentation on http://webpy.org/install#apachemodwsgi,
> but it doesn't show where exactly in httpd.conf I should place the
> commands.
>
>
> In my example I would like to get start page, simply by typing in my
> browser e.g. http://localhost:8070, and my file is located in: c:/wamp/
> www/xaura/run.py
>
>
> source of run.py:
>
>
> #!/usr/bin/env python
>
> import web
>
> urls = ('/', 'hello',
>        '', 'hello')
>
> class hello:
>    def GET(self):
>        return "Hello, world."
>
> app = web.application(urls, globals())

Change this to:

  application = web.application(urls, globals())

For mod_wsgi it must be called 'application'.

> if __name__ == "__main__": app.run()

Change this to:

  if __name__ == "__main__": application.run()

The application.run() isn't invoked under mod_wsgi. It would only be
used if you were running on command line, which you don't need to for
mod_wsgi.

Suggest though you first go back and following the mod_wsgi
instructions for how to set up a hello world. Get that going first.
Then change your script to above.

See:

  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

and follow what it tells you to do.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to