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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:12:02+00:00 2026-06-12T03:12:02+00:00

I am writing a website with python and jinja2 in google app engine. My

  • 0

I am writing a website with python and jinja2 in google app engine. My html page is showing this on the page:

Status: 200
Content-Type: text/html;
charset=utf-8
Cache-Control: no-cache
Content-Length: 432

Any idea where this problem is coming from? Also, why is {{ initial_city }} not displaying the results?

My main.py script is:

from google.appengine.ext import db
from google.appengine.api import memcache
from models import Deal
import os
import webapp2
import jinja2


#databasestuff
deal = Deal(title='Hello',
        description='Deal info here',
        city='New York')
deal.put()
print deal


jinja_environment = jinja2.Environment(autoescape=True,
    loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates')))

class MainPage(webapp2.RequestHandler):
def get(self):
    template = jinja_environment.get_template('index.html')
    self.response.out.write(template.render())


class DealHandler(webapp2.RequestHandler):
def get(self):
    def get_deals(choose_city, update=False):
        key = str(choose_city)
        all_deals = memcache.get(key)
        return all_deals

    choose_city = self.request.get('c')
    try:
        initial_city = str(choose_city)
        choose_city = initial_city
    except ValueError:
        initial_city = 0
        choose_city = initial_city


    template = jinja_environment.get_template('deal.html')
    self.response.out.write(template.render())




class ContentHandler(webapp2.RequestHandler):
def get(self):
    template = jinja_environment.get_template('content.html')
    self.response.out.write(template.render())

app = webapp2.WSGIApplication([('/', MainPage),
                           ('/deal', DealHandler),
                           ('/content', ContentHandler)],
                          debug=True)

My html page:

<!DOCTYPE html>
<html>
  <head>
    <title>
      Deallzz: Chosen City: {{ initial_city }}
    </title>
  </head>
  ...
  • 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-12T03:12:04+00:00Added an answer on June 12, 2026 at 3:12 am

    To display initial_city, pass the variable to the template using the render method:

    self.response.out.write(template.render(initial_city = initial_city))

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

Sidebar

Related Questions

I am writing a website on Google App Engine in Python and I have
I am writing a website intro page and really like the style on this
I'm trying to use go instead of python for my website on google app
I am writing python script which gets links from website. But when I tried
I am writing a python website built on the back of the django framework,
I am writing my website's backend using Flask and Python 2.7, and have run
I'm writing a python script that scrapes a website, where the website uses OpenID
I am writing this little python program that will get new posts on the
I'm pretty new to Python and, in writing an app, have ended up with
I am currently writing a website in nothing more than HTML and CSS for

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.