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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:46:17+00:00 2026-05-27T17:46:17+00:00

How do I make web.py fetch a page when I click on a link?

  • 0

How do I make web.py fetch a page when I click on a link?
I have this in my template:

<a href='add.html'>Home</a>

When I click on ‘Home’, I get ‘not found’.

In my application, I have ‘/add’ mapped to the ‘Add’ class which returns ‘Boom!’ using the template add.html.

urls = ('/', 'Index',
    '/add','Add')

class Add(object):
    def GET(self):
        return render.add('Boom!')

I feel when I request for /add.html, the Add class will handle the request and return ‘Boom!’

Why do I keep getting ‘not found’?

  • 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-27T17:46:18+00:00Added an answer on May 27, 2026 at 5:46 pm

    The origin of a page URI ending in .html lilke /add.html is that in static hosting environments those were traditionally really single text files with html-content and the file ending for such a file is .html

    But your system is dynamic and creates web pages on the fly. It does not necessarily need the pages ending in .html. Although you can mimic the traditional behaviour if you desire.

    But in a modern and dynamic system it is often preferred that there is no ending on the single “pages” at all.

    So you could, as Ignacio also suggests, just get rid of the .html and request the /add page, which is a valid and sufficient unique identifier for that resource.

    If you like to keep the .html ending. you have to add it also in the route.

    urls = (
      '/', 'Index',
      '/add.html','Add',
    )
    

    You can also have multiple routes pointing to the same resource, so that both /add and /add.html are valid and showing the same content, but content duplication has other drawbacks:

    urls = (
      '/', 'Index',
      '/add','Add',
      '/add.html','Add',
    )
    

    I recommend getting rid of the .html. This means you stick with the code from your question and create links to the page like this:

    <a href="/add">add something</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have previously written my web apps with a server side / html template
I'm trying to make a web scraper that will parse a web-page of publications
This code works correctly to make a web service call: int numberOfGuests = Convert.ToInt32(search.Guest);
This is a general design question about how to make a web application that
I never understood this: in web development whe[ n|re ] does it make sense
I have a scrollable GridView in my Web Part and I have to make
I have to fetch multiple web pages, let's say 100 to 500. Right now
I want to fetch a list of all Salesforce objects. I found this link
I have a crawler that fetch documents across web pages. when i receive a
I have to store messages that my web app fetch from Twitter into a

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.