Questions tagged [beaker]

Beaker is a library for caching and sessions for use with web applications and stand-alone Python scripts and applications. It comes with WSGI middleware for easy drop-in use with WSGI based web applications, and caching decorators for ease of use with any Python based application.

Beaker is a library for caching and sessions for use with web applications and stand-alone Python scripts and applications. It comes with WSGI middleware for easy drop-in use with WSGI based web applications, and caching decorators for ease of use with any Python based application.

For more information, read the documentation at: https://beaker.readthedocs.io/en/latest/index.html


Beaker is also the name of a full-stack software and hardware integration testing system, with the ability to manage a globally distributed network of test labs. Use the beaker-testing tag instead of this tag for questions about Beaker the testing system.

114 questions
1
vote
0 answers

Flask Beaker session "AttributeError: 'Session' object has no attribute 'permanent'"

I'm using Beaker with Memcached for session management in a Flask based application, but I'm getting "AttributeError: 'Session' object has no attribute 'permanent'" while logging out a user also sometimes when the user session is active. See Error…
user2264738
  • 302
  • 4
  • 18
1
vote
2 answers

Are there any concerns I should have about storing a Python Lock object in a Beaker session?

There is a certain page on my website where I want to prevent the same user from visiting it twice in a row. To prevent this, I plan to create a Lock object (from Python's threading library). However, I would need to store that across sessions. …
Jack Edmonds
  • 31,931
  • 18
  • 65
  • 77
1
vote
0 answers

pyramid_beaker sometimes suffers SqlAlchemy error: already defined for this MetaData instance

I'm using beaker for my session cache in Pyramid web app, since my production environment will have multiple web servers. During development, under circumstances that cause beaker to re-initialize I get an error that beaker_cache table is already…
Corey Coogan
  • 1,569
  • 2
  • 17
  • 31
1
vote
1 answer

Try to make beaker session work with gunicorn in python Bottle framework

I am using bottle to write a small web program and name the following source file index.py. I also use beaker session library in the program. When I run the code using python index.py everything goes right. But when I use gunicorn -c gunicorn.conf…
newguy
  • 5,668
  • 12
  • 55
  • 95
1
vote
1 answer

Enabling Beaker SessionMiddleware through Bottle on Google App Engine

I am trying to use beaker for session handling in my bottle based GAE app. The problem is that I need to run "app" here as the app session_opts = { 'session.type': 'ext:google', 'session.auto': True, } app =…
Rested
  • 187
  • 2
  • 9
1
vote
1 answer

pyramid beaker - session never expired

I am currently developing application in pyramid framework. Following are my settings in development.ini session.type = file session.data_dir = data/sessions/data session.lock_dir = data/sessions/lock session.key = mykey session.secret =…
Aniruddha
  • 3,513
  • 6
  • 27
  • 38
1
vote
1 answer

How to get a callback notification when Http session expired

I am using python bottle with Beaker to manage Http sessions. So far I know how to set beaker session timeout parameters, and the sessions are cleaned automatically once expired, but I need to do extra DB cleanup when a session expired. does anyone…
Duy Hsieh
  • 21
  • 2
1
vote
0 answers

Transfer Beaker Memcache into SqlAlchemy (MySQL)

I work with Flask and want to create some user sessions working on database. Thanks to some help I found this snippet http://flask.pocoo.org/snippets/61/ from flask import Flask, request from beaker.middleware import SessionMiddleware session_opts…
Archarachne
  • 235
  • 1
  • 5
  • 18
1
vote
1 answer

Set a global variable for all mako templates using bottle?

I'm using bottle with beaker as session middleware. I'd like to include my session object in all my mako templates without specifying it when rendering: Instead of this: return mako_template("myView", { "session" :…
Andreas
  • 1,211
  • 1
  • 10
  • 21
1
vote
1 answer

How to prevent user to set the value of the session id cookie used by pyramid_beaker?

I have a pyramid application using pyramid_beaker. Here is my configuration: # Options For Sessions and Caching: session.type = file session.data_dir = %(here)s/../../data/sessions/data session.lock_dir = %(here)s/../../data/sessions/lock # Session…
user1919510
1
vote
1 answer

Storing session data in database in Pyramid using beaker

I'm building a web application in Pyramid and it needs user logins. Database backend is a MySQL DB connected via SQLAalchemy. Pyramid has an introduction on using beaker for sessions, but it only shows how to configure it using files. I couldn't…
kratenko
  • 7,354
  • 4
  • 36
  • 61
1
vote
2 answers

Getting started with pyramid beaker and uwsgi

I'm kind of lost here. How can I get started with a python script using pyramid beaker. I prefer to invoke it through uwsgi like this: uwsgi -s :9001 --module script but when I call it using curl I get KeyError: 'beaker.session' script.py is…
user1154664
  • 1,392
  • 13
  • 11
1
vote
1 answer

last_accessed time in beaker session always None, but _accessed_time is changing

I'm using beakers WSGI SessionMiddleware to manage a session between browser and application. I am trying to differentiate between when a session is first accessed against any further requests. Fom the docs it appears there are two useful values…
Matt Warren
  • 669
  • 8
  • 18
1
vote
1 answer

Web design pattern for a user modifiable list that persists across multiple form submissions and page updates?

I'm working on a web application (bottle + beaker + jQuery ) where I'd like the user to have a somewhat modifiable list of items which persists across various form submissions and page updates. Clicking on an item in the list queries a database for…
pgoetz
  • 848
  • 1
  • 8
  • 18
1
vote
0 answers

How to get the value with key in pyramid_beaker for memcached?

@cache_region('day', 'my_search_func')$ def _query(tags, num, searchid=None): ... I used decorate API in beaker, then, can get the beaker.cache.Cache object through the…
kennyeric
  • 43
  • 4