Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:44:57+00:00 2026-05-28T06:44:57+00:00

I am trying to use pyramid beaker in Pyramid framework and its just not

  • 0

I am trying to use pyramid beaker in Pyramid framework and its just not working it creates the session objects but i cannot access them with the line

@view_config(route_name='load_qli', renderer='json')
def load_qli(request):
    request.environ['beaker.session']

It gives the following error

KeyError

KeyError: 'beaker.session'

My development.ini file looks like this

# pyramid_beaker settings
session.type = file
session.data_dir = %(here)s/data/sessions/data
session.lock_dir = %(here)s/data/sessions/lock
session.key = customerskey
session.secret = customerssecret
session.cookie_on_exception = true

and init.py like this

from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from qlipe.models import DBSession
from pyramid_mailer import mailer_factory_from_settings
from pyramid_beaker import session_factory_from_settings


def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)


    # pyramid_beaker add-on
    session_factory = session_factory_from_settings(settings)   

    config = Configurator(
        settings=settings, 
        session_factory=session_factory
    )

I create the session like this

def my_view(request):
    session = request.session
    session['name'] = 'Fred Smith'
    session.save()

Where am i going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:44:57+00:00Added an answer on May 28, 2026 at 6:44 am

    You should be able to just use the include way and the pyramid_beaker package can initialize itself from the ini values.

    in your ini file:

    pyramid_includes = pyramid_beaker
    

    or inside your main function’s __init__.py file:

    config.include('pyramid_beaker')
    

    You can read more here http://docs.pylonsproject.org/projects/pyramid_beaker/en/latest/#setup

    The usual way to access the session is through the request like you do in my_view:

    session = request.session
    

    The pyramid_beaker package use the pyramid session factory and the way it manages the session is not through the request.environement[‘beaker.session’] object like beaker’s example. For more info read http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/sessions.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really interested in trying out the Pyramid Framework but only half of my
I am trying use a Java Uploader in a ROR app (for its ease
I am trying use filehelpers class builder but I am kinda confused on what
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
We're trying to set up a Pyramid project that will use MySQL instead of
I am trying use std::copy to copy from two different iterator. But during course
I am trying use Thread but i have some problem (I am beginner at
I'm trying use double type in openCL, but doesn't work anyway, i want use
Trying to use a guid as a resource id in a rest url but
Im trying use a Java annotation in a Groovy class but have trouble to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.