I have installed apache and mode_wsgi. There are two files in website
folder: bottle.py and app.py
This code in app.py runs ok
#**********************************************************************
#-*- coding: utf-8 -*-
import pprint
def wsgi_app(environ, start_response):
""" Display the contents of the environ dictionary."""
# produce some content
output = pprint.pformat(environ)
# send first header and status
status = '200 OK'
headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, headers)
# wsgi apps should return and iterable, the following is
acceptable too :
# return [output]
yield output
# mod_wsgi need the *application* variable to serve our small app
application = wsgi_app
#**********************************************************************
but when i replace it with helloworld:
#**********************************************************************
from bottle import route, run
@route('/')
def index():
return 'Hello World!'
# File: /var/www/yourapp/app.wsgi
# Change working directory so relative paths (and template lookup)
work again
os.chdir(os.path.dirname(__file__))
import bottle
application = bottle.default_app()
#**********************************************************************
I get internal error.
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] mod_wsgi
(pid=5320): Target WSGI script 'C:/www/app.py' cannot be loaded as
Python module.
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] mod_wsgi
(pid=5320): Exception occurred processing WSGI script 'C:/www/app.py'.
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] File "C:/www/
app.py", line 2, in <module>
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] from bottle
import route, run
[Fri May 21 13:11:50 2010] [error] [client 127.0.0.1] ImportError: No
module named bottle
--
You are member of the "bottlepy" group at google groups.
See
http://groups.google.de/group/bottlepy for mailing list options.
See
http://bottle.paws.de/ for news and documentation.