Pyramid: how to set cookie without renderer?
问题 In configuration file: config.add_route('lang', '/lang-{code}') In views: @view_config(route_name='lang') def lang(request): code = request.matchdict['code'] response = Response() response.set_cookie('lang', value=code, max_age=31536000) # max_age = year return HTTPFound(location=request.environ['HTTP_REFERER']) The mechanism is simple: there is a dropped down menu item with languages and clicking on anyone must refresh site with new locale. Runs without errors, but no cookie set up... What I