Python:Redis 作为 Beaker 的会话后端

发布于 2024-09-08 14:38:04 字数 84 浏览 13 评论 0原文

有人成功使用 Redis 作为 Beaker 后端吗?你能告诉我链接或库如何做到这一点吗?我正在寻找任何可以执行此操作但无法从谷歌搜索中获取任何内容的库。

Anyone had success with using Redis as Beaker backend? Can you tell me link or library how to do it? I am looking for any library which does this but could not get anything out of google search.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蔚蓝源自深海 2024-09-15 14:38:04

我已发布到 pylons 用户组,此信息解决了我的问题。

http:// groups.google.com/group/pylons-discuss/msg/a1144aa1ca8e0417

以下是对我有用的步骤:

  1. easy_install redis
  2. easy_install pip
  3. pip install git+git://github.com/bbangert/beaker_extensions.git
  4. < p>编辑 Pylons 的development.ini

    <前><代码>[应用程序:主]
    全栈=真
    静态文件 = true

    cache_dir = %(此处)s/数据
    烧杯.session.type = redis
    烧杯.session.url:127.0.0.1:6379
    beaker.session.key = 应用程序名称

  5. (可选)
    编辑此文件并将序列化方法更改为 JSON。甚至
    虽然 JSON 的字节对字节效率不高,但我喜欢它的简单性
    在我所使用的技术中可读且得到相对良好的支持
    选择:

https://github.com/bbangert/beaker_extensions/blob/master /beaker_extensions/redis_.py

由 Jeff Tchang 发布

I have posted to pylons user group and this information resolve my question..

http://groups.google.com/group/pylons-discuss/msg/a1144aa1ca8e0417

Here are the steps that worked for me:

  1. easy_install redis
  2. easy_install pip
  3. pip install git+git://github.com/bbangert/beaker_extensions.git
  4. Edit Pylons' development.ini

    [app:main]
    full_stack = true
    static_files = true
    
    cache_dir = %(here)s/data
    beaker.session.type = redis
    beaker.session.url:127.0.0.1:6379
    beaker.session.key = appname
    
  5. (Optional)
    Edit this file and change the serialization method to JSON. Even
    though JSON is not as efficient byte for byte I like how it is easily
    readable and relatively well supported across the technologies I've
    chosen:

https://github.com/bbangert/beaker_extensions/blob/master/beaker_extensions/redis_.py

Posted by Jeff Tchang

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文