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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:20:46+00:00 2026-06-05T22:20:46+00:00

I want to have multiple pages in google-app engine (python 2.7) and the followoing

  • 0

I want to have multiple pages in google-app engine (python 2.7) and the followoing is my directory structure:
root contains: pujaweb.py (the main script), index.html, stylesheets(folder), port(folder)…

now my second script for the page is in the port folder and i want to configure my index.html such that it links to that page. I have tried a lot of stuff but somehow it does not work and always shows 404 page not found error and the command line says that PujaPort module does not exist (pujaport being the app handler for the second page).

the following is my app.yaml file code:

application: thepujabhalerao

version: 1

runtime: python27

api_version: 1

threadsafe: true



handlers:

- url: /images

  static_dir: images





- url: /stylesheets

  static_dir: stylesheets


- url: /port
  script: pujaport.app


- url: /.*

  script: pujaweb.app



libraries:

- name: jinja2

  version: latest

this is my main handler (pujaweb.py)

import cgi

import webapp2 

import jinja2

import os

from google.appengine.api import xmpp

from google.appengine.ext import db





jinja_environment = jinja2.Environment(

    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))



class MainPage(webapp2.RequestHandler):

  def get(self):

      template_values = {}

      template = jinja_environment.get_template('index.html')

      self.response.out.write(template.render(template_values))




app = webapp2.WSGIApplication([('/', MainPage)],

                              debug=True)

and the href in the index filer looks like this:

<a href="/port/">P</a>

and finally this is the second page handler pujaport.py:

    import cgi

import webapp2 

import jinja2

import os

from google.appengine.api import xmpp

from google.appengine.ext import db





jinja_environment = jinja2.Environment(

    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))



class PujaPort(webapp2.RequestHandler):

  def get(self):

        self.response.out.write("In handler")




app = webapp2.WSGIApplication([('/port', PujaPort)],

                              debug=True)

I know its a minor glitch somewhere but please help me out as after being on it for too long i maybe missing the obvious.

  • 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-05T22:20:48+00:00Added an answer on June 5, 2026 at 10:20 pm

    If you insist on using that folder structure, you’ll need to make the port directory into a package by adding an __init__.py file to it (which can be empty), and reference the app as port.pujaport.app, its fully qualified name.

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

Sidebar

Related Questions

I have an array that I want on multiple pages, so I made it
I have some content that I want to appear on multiple pages of my
I have multiple pages containing the same partial view. The partial contains a form
I am building a web app with google app engine with python as well
I have multiple buttons on a page and I want to simulate a click
I have multiple document.ready functions on a page and I want a function to
I have multiple forms on a page, for each of them I want the
I have multiple input textboxes in my page. I want to reset particular text
I want to have multiple multiple choices given to user after the form submit
I want to have a tree in memory, where each node can have multiple

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.