Hello,
i am trying to set up web.py to run with apache2 and wsgi. I installed
mod_wsgi and changed the .htaccess file to
<Files code.py>
SetHandler wsgi-script
Options ExecCGI FollowSymLinks
</Files>
which seems to work, as my code.py is responding.
However, if i call the URL for my app, ( http://localhost/~me/webpy/code.py/
) the script raises the error
<type 'exceptions.AttributeError'> at /
No template named index
When running the test server, the template is found in the subfolder
'templates/'. I found a post in this group that suggested setting an
absolute template path like this:
import sys, os
rootdir = os.path.abspath(os.path.dirname(__file__)) + '/'
render = web.template.render(rootdir+'templates/')
This did not change the problem though.
Another problem is that, if i'm not using a template, but simply
return of text message, like
class test:
def GET(self):
return "WHUT"
a http header of the type text/x-python is generated, resulting in the
browser prompting me to download the file.
$ HEAD localhost/~me/webpy/code.py/test
200 OK
Connection: close
Date: Wed, 22 Sep 2010 12:58:46 GMT
Server: Apache/2.2.14 (Ubuntu)
Content-Type: text/x-python
Client-Date: Wed, 22 Sep 2010 12:58:46 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
I think i missed out some WSGI configuration.
Can anybody help?
(My goal is to move a group of design students away from PHP to
python, and i want to provide an easy environment for them to work.)
Best greetings,
Dragan
--
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en.