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

The Archive Base Latest Questions

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

I have a server-side webpy code like this: urls = ( ‘/home’, ‘homePage’, ‘/clients/(.*)’,

  • 0

I have a server-side webpy code like this:

urls = (
    '/home', 'homePage',
    '/clients/(.*)', 'clientsPage',
    )

# Class for common pages methods and parameters
class allpages(object): ....

    def logout(self):
        i=web.input().keys()[0]
        if i=='logout': session.kill()
        return

class homePage(allpages):
    def GET (self):
        self.loginCheck()
        return self.showpage('home',self.userName())

    def POST (self):
        self.logout()
        return

class clientsPage(allpages):
    def GET (self, client):
        self.loginCheck()
        if client == '': clientID=renderInc.firmlist('clients')
        elif client == 'new': clientID=renderInc.newfirm('clients')
        else: clientID = 'There is no such client' #TODO: make a 404 page
        return self.showpage('clients',clientID)

    def POST (self):
        self.logout()
        return

in one of my HTML-templates (footer) there is a button “Logout” that runs a script on click:

jQuery('#logout').click(function(){
    jQuery.post(path,{'logout':''}, function(){location.reload();});
});

Everything works fine in /home section, but when I try to logout from /clients/ pages, it raises an error: TypeError: POST() takes exactly 1 argument (2 given).

Question 1: Why it happens?
Question 2: Is there any way to make any methods run in POST on every page by default (not to copy self.logout() line in every class.

  • 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-28T02:11:57+00:00Added an answer on May 28, 2026 at 2:11 am

    Question1:
    The capture in the regex for clientsPage – (.*) tells web.py that you want to capture that part of the URL and pass it as an argument to the POST method. From your code, it looks like that is the client id.

    Question2:
    I’d just use a seperate URL for logout. You don’t need to have a logout for every page.

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

Sidebar

Related Questions

I have a server side code to process uploaded binary files: class UploadHandler(webapp.RequestHandler): def
I have done a bit of testing on this myself (During the server side
I have a server side class which I make available on the client side
I have a server side object. public class OptionRelation { public intOptionId { get;
I have a Server side variable by the following code Dim mgps As New
I know this has been asked a lot, but I have a server-side custom
I have a server-side zip archive that I would like to pass along as
I have a server side ImageButton, and a server side Button, and then a
I'm trying to adress the following issue: I have a server side .net application
What tools for server side application performance testing you suggest? Have an application server

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.