ich wollte mich mal ein bisschen mit dem Webframework Bottle beschäfftigen.
Habe dann mal meinen Webspace bei Hosteurope so eingestellt (wie die FAQs es beschreiben) damit Python ausgeführt wird.
Wenn ich z.B eine Datei (index.py) mit folgendem Inhalt:
Code: Alles auswählen
#!/usr/bin/python
print 'Content-Type: text/html\r\n\r\n'
print '<html><body>test</body></html>'
Wenn ich dann aber eine einfache Bottle Anwendung mache gehts leider nicht.
Hier der Source:
Code: Alles auswählen
#!/usr/bin/python
import bottle
bottle.debug(True)
@bottle.route('/')
def test():
return 'test'
application = bottle.default_app()
Code: Alles auswählen
sys.path = ['/is/htdocs/wp12345678_XXXXJ5I5XZ'] + sys.path
os.chdir(os.path.dirname(__file__))
Premature end of script headers: index.py
Dann hatte ich noch nen Beitrag gefunden, wo noch sowas drinne stand:
Code: Alles auswählen
if __name__ == '__main__':
from wsgiref.handlers import CGIHandler
CGIHandler().run(bottle.default_app())
Dann kommt als Fehler:
Code: Alles auswählen
Internal Server Error
Exception:
KeyError('PATH_INFO',)
Traceback:
Traceback (most recent call last):
File "/is/htdocs/wp10472298_TZJNJ5I5XZ/www/bottle.py", line 650, in _handle
callback, args = self._match(environ)
File "/is/htdocs/wp10472298_TZJNJ5I5XZ/www/bottle.py", line 505, in _match
handle, args = self.router.match(environ)
File "/is/htdocs/wp10472298_TZJNJ5I5XZ/www/bottle.py", line 303, in match
targets, urlargs = self._match_path(environ)
File "/is/htdocs/wp10472298_TZJNJ5I5XZ/www/bottle.py", line 321, in _match_path
path = environ['PATH_INFO'] or '/'
KeyError: 'PATH_INFO'
Ich weiß echt nicht mehr was ich noch ausprobieren kann.
Ach so bei Hosteurope ist Python 2.5 installiert und Bottle is Version 0.9.2
EDIT:
Es ist nur Webspace, kein vServer! Ich kann also nicht an der Apache Konfiguration rumbasteln!