Trailing_slash ツールが機能しません。Trailing_slash ツールのオプションをいじってみましたが、何も効果がないようです。私は CherryPy 3.2.2 と Routes 1.13 を使用しています。末尾にスラッシュを追加したいと思います。デバッグ出力にエラーはありません。
127.0.0.1:8080/blog/ にアクセスすると機能しますが、127.0.0.1:8080/blog にアクセスすると機能しません。
私の構成は次のとおりです。
conf = {
'/': {
'request.dispatch': setup_routes(),
# This trailing slash stuff has no effect :(
'tools.trailing_slash.on': True,
'tools.trailing_slash.missing': True,
'tools.trailing_slash.status': 301,
},
'/static': {
'tools.staticdir.on': True,
'tools.staticdir.root': os.path.dirname(os.path.abspath(__file__)),
'tools.staticdir.dir': 'static'
}
}
ルートの例は次のとおりです。
routes = [["blog_index", "/blog/", {'controller': BlogController(), 'action': 'index','entry_id': 'index'}],]
誰かが私が間違っていることを見ることができますか? バグや重要なドキュメントの不足はありますか? Trailing_slash ツールは Routes Dispatcher で動作しますか?