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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:12:42+00:00 2026-05-18T05:12:42+00:00

I got a simple app on google app engine using django and I have

  • 0

I got a simple app on google app engine using django and I have two classes that look pretty much identical, but one of them crashes with TypeError.

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3211, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3154, in _Dispatch
    base_env_dict=env_dict)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 527, in Dispatch
    base_env_dict=base_env_dict)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2404, in Dispatch
    self._module_dict)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2314, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2212, in ExecuteOrImportScript
    script_module.main()
  File "C:\Development\fuluus\momadthenomad\main.py", line 20, in main
    run_wsgi_app(application)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\util.py", line 97, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\util.py", line 115, in run_bare_wsgi_app
    result = application(env, _start_response)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 500, in __call__
    handler = handler_class()
TypeError: NotFoundPage() takes exactly 1 argument (0 given)

My class looks like this (main.py):

import os
import datetime

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app

class BasePage(webapp.RequestHandler):
   def initialize(self, request, response):
       webapp.RequestHandler.initialize(self, request, response)
       dir = os.path.join(os.path.dirname(__file__), "../templates")
       self.template_path = os.path.abspath(dir)

   def render_to_response(self, page, template_values):
       page_path = os.path.join(self.template_path, page)
       self.response.out.write(template.render(page_path, template_values))


class DefaultPage(BasePage):
   def get(self):
      visitor = Visitor()
      visitor.ip = self.request.remote_addr
      visitor.put()

      page = Page()
      page.title = "MY PORTAL"
      page.subtitle = "Home"
      page.name = self.request.path

      visitors_query = Visitor.all().order('-added_on')
      visitors = visitors_query.fetch(20)

      self.render_to_response("main.html",
        {
            "page": page,
            "visitors":  visitors,
        })


def NotFoundPage(BasePage):
   def get(self):
      page = Page()
      page.title = "MY PORTAL"
      page.subtitle = "Not Found"
      page.name = self.request.path

      self.render_to_response("empty.html", 
        {
           "page": page,
        })

application = webapp.WSGIApplication(
                                    [('/', DefaultPage),
                                     ('/index.html', DefaultPage),
                                     ('/.*', NotFoundPage),
                                     ],
                                    debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()

When I go to /index.html, everythin works perfectly. But when I go to /not-found.html, it crashes with the error. I can’t figure out what is wrong with this script. Maybe I am overlooking something. Please help.

  • 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-18T05:12:43+00:00Added an answer on May 18, 2026 at 5:12 am
    def NotFoundPage(BasePage):
    

    should be:

    class NotFoundPage(BasePage):
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a simple little WPF app with a TextBox and a WebBrowser control.
I've got a simple MVC (RC1) app set up, and I'm seeing some odd
I've got a simple class that inherits from Collection and adds a couple of
I've got a simple application that shows pictures dragged onto it. I'd like the
I've got a simple asmx web service that just needs to log some information
I've got a simple java class that looks something like this: public class Skin
I got a simple page with a HtmlInputHidden field. I use a javascript to
I've got a simple CakePHP site (1.2) . I've got a page where you
I've got a simple function like this: function CreateFileLink() { global $Username; return date(d-m-y-g-i);
I've got a simple WPFToolkit DataGrid : <Grid> <dg:DataGrid Name=theDataGrid/> </Grid> And in code

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.