Help with webpy setup - browser just shows code, not hello, world

39 views
Skip to first unread message

Barry

unread,
Aug 21, 2012, 3:01:53 PM8/21/12
to we...@googlegroups.com
Hi I'm having some problems setting up webpy on mac OS X. I've got webpy and mod_wsgi installed correctly but when I go to http://localhost/test/code.py it just shows the code in the browser instead of hello, world.

This is what i've got in my httpd.conf file:

LoadModule wsgi_module        libexec/apache2/mod_wsgi.so

WSGIScriptAlias /test /Users/Administrator/web/code.py/

Alias /test /Users/Administrator/web/

AddType text/html .py

<Directory /Users/Administrator/web/>
    Options Indexes FollowSymLinks
    Order deny,allow
    Allow from all
</Directory>

and in my code.py file I have:

 import web

  urls = (
      '/.*', 'hello',
      )

  class hello:
      def GET(self):
          return "Hello, world."

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

Any help would be greatly appreciated.

Barry

unread,
Aug 21, 2012, 11:33:10 PM8/21/12
to we...@googlegroups.com

Update:

I changed this:
Alias /test /Users/Administrator/web/
to this:
Alias /test/static /Users/Administrator/web/static/

Then I noticed there was an indentation error in the python code do fixed that. All working now.
Reply all
Reply to author
Forward
0 new messages