Code: Alles auswählen
#!/usr/bin/python
from bottle import route, run, request, response, send_file, abort, template
@route('/')
def hello_world():
return 'Hello World!'
@route('/hello/:name')
def hello_name(name):
return 'Hello %s!' % name
@route('/hello', method='POST')
def hello_post():
name = request.POST['name']
return 'Hello %s!' % name
@route('/static/:filename#.*#')
def static_file(filename):
send_file(filename, root='/path/to/static/files/')
@route('/template/test')
def template_test():
return template('template', title='Template Test', items=[1,2,3,'hallo'])
bottle.run('localhost', port=8080)
Code: Alles auswählen
AddHandler wsgi-script .wsgi
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /test.py/$1 [QSA,PT,L]
ich hoffe ihr könnt mir helfen
mfg
PS: was muss ich eig in die test.py als server und port rein?, ich hab jetzt localhost und port 80[/code]