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

  • Home
  • SEARCH
  • 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 8844181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:25:18+00:00 2026-06-14T11:25:18+00:00

I added webapp2 sessions to my project on appengine which uses webapp2 for request

  • 0

I added webapp2 sessions to my project on appengine which uses webapp2 for request handling and django for templates.

Following this page, I added the following to my script

import webapp2

from webapp2_extras import sessions

class BaseHandler(webapp2.RequestHandler):
    def dispatch(self):
        # Get a session store for this request.
        self.session_store = sessions.get_store(request=self.request)

        try:
            # Dispatch the request.
            webapp2.RequestHandler.dispatch(self)
        finally:
            # Save all sessions.
            self.session_store.save_sessions(self.response)

    @webapp2.cached_property
    def session(self):
        # Returns a session using the default cookie key.
        return self.session_store.get_session()

config = {}
config['webapp2_extras.sessions'] = {
    'secret_key': 'my-super-secret-key',
}

However, now I get the following error

Traceback (most recent call last):
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/home/user/sites/project2n/main.py", line 804, in dispatch
    self.session_store = sessions.get_store(request=self.request)
  File "/home/user/google_appengine/lib/webapp2/webapp2_extras/sessions.py", line 454, in get_store
    store = request.registry[key] = factory(request)
  File "/home/user/google_appengine/lib/webapp2/webapp2_extras/sessions.py", line 308, in __init__
    required_keys=('secret_key',))
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1361, in load_config
    self._validate_required(key, config, required_keys)
  File "/home/user/google_appengine/lib/webapp2/webapp2.py", line 1375, in _validate_required
    'Missing configuration keys for %r: %r.' % (key, missing))
Exception: Missing configuration keys for 'webapp2_extras.sessions': ['secret_key']

I have set the secret key, using config. I am not using anything else for sessions. The other imports are

import os,sys, string, time, sha, Cookie
from django.template import Context, Template
from django.template.loader import get_template
  • 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-06-14T11:25:19+00:00Added an answer on June 14, 2026 at 11:25 am

    You need to include this config somewhere, such as in the WSGI app you create:

    app = webapp2.WSGIApplication([('/path', MyHandler)],
                                  config=config,
                                  debug=True)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my webapp I have a page called display.php. The script in this page
I have added some web methods to my ASP.NET page like the following to
I added to my system-wide /etc/security/limits.conf the following two rows: * soft rtprio 55
I added this part of the code in my onCreate() method and it crashes
I added a user control in my MyDashboards.aspx page; <uc:dlUC ID=dashboardListUserControl runat=server OnInit=ConfigureDashboardList />
I'm developing a WebApp for Android, so I've added a custom button like this:
I'm trying to move my gae webapp project to django non-rel. I'm pretty new
I'm using webapp with Google App Engine. I recently added a call to request.get('variable_name')
I added the file appengine_config.py with this instruction webapp_django_version = '1.2' Here is some
i have added a linkbutton to my page and get error when debugging says:

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.