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 6966965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:15:37+00:00 2026-05-27T16:15:37+00:00

I am still running into errors with webapp2 and am at a lost what

  • 0

I am still running into errors with webapp2 and am at a lost what could be the problem here.

ERROR    2011-12-13 11:17:19,059 webapp2.py:1528] 'NoneType' object has no attribute 'route'
Traceback (most recent call last):
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 526, in dispatch
    method_name = request.route.handler_method
AttributeError: 'NoneType' object has no attribute 'route'
ERROR    2011-12-13 11:17:19,060 wsgi.py:186]
Traceback (most recent call last):
  File "/home/user/sdk/google_appengine/google/appengine/runtime/wsgi.py", line 174, in Handle
    result = handler(self._environ, self._StartResponse)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1519, in __call__
    response = self._internal_error(e)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 526, in dispatch
    method_name = request.route.handler_method
AttributeError: 'NoneType' object has no attribute 'route'

Please note that I am using the latest SDK version (1.6.0) of GAE.

My code looks like this:

app.yaml

application: test-app
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /favicon\.ico
  static_files: static/images/favicon.ico
  upload: static/images/favicon\.ico

- url: .*
  script: main.site_app
  login: required

libraries:
- name: django
  version: "1.2"

main.py

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

import webapp2
import urls

site_app = webapp2.WSGIApplication(urls.SITE_URLS, debug=True)

urls.py

import webapp2

import handler

SITE_URLS = [
  webapp2.Route(r'/', handler.TestHome),
  webapp2.Route(r'/test/<test_key:\w+>', handler.TestPage)
]

basehandler.py

import os
import webapp2
from django import template

class BaseHandler(webapp2.RequestHandler):

  def __init__(self, *args, **kwargs):
    self.tdict = {}

  def render(self, template_file):
    template_path = os.path.join(os.path.dirname(__file__),
                                 'templates',
                                 template_file)
    t = template.Template(file(template_path,'rb').read())
    self.response.write(t.render(template.Context(self.tdict)))

handler.py

import os
from basehandler import BaseHandler

class TestHome(BaseHandler):

  def get(self):
    def get(self):
    self.render('browse.html')


class TestPage(BaseHandler):

  def get(self, test_key):
    self.tdict['test_key'] = test_key
    self.render('browse.html')

templates/browse.html

<html>
<head>
  <title>Success!</title>
</head>
<body>
Success!
{% if test_key %}- {{ test_key }}{% endif %}
</body>
</html>

What am I doing wrong? Any help/suggestions are greatly appreciated!

  • 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-27T16:15:38+00:00Added an answer on May 27, 2026 at 4:15 pm

    I think it is because you didn’t call the webapp2.RequestHandler.__init__(). Here is a code snippet from webapp2.py:

    class RequestHandler(object):
        # ...
        def __init__(self, request=None, response=None):
            self.initialize(request, response)
    

    As you can see the RequestHandler is initialized with request and response. So you have to do same thing in your code:

    class BaseHandler(webapp2.RequestHandler):
        def __init__(self, request, response):
            self.tdict = {}
            self.initialize(request, response)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed the advice here, but I'm still running into the same issues after
My program is now still running to import data from a log file into
I'm running into a problem related to caching, plugins and duplicate model names in
I always wondered why people are still running older web browsers until I started
Attempting to implement a poor man's test of whether a process is still running
I am a bit of a noob still with rails, but I am running
I am running into a strange issue in perl that I can't seem to
I have suddenly been getting the memory exception errors for two programs running on
TypeError: Result of expression 'this._configure' [undefined] is not a function. I keep running into
I am running into a blank page, and although I have told PHP 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.