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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:23:38+00:00 2026-05-30T15:23:38+00:00

In my python Google App Engine app, the design for most of my pages

  • 0

In my python Google App Engine app, the design for most of my pages is identical, so I created page.html as a basic template. The content for each individual page is in a .txt file. In my .py script I do this:

pageFile = open("content.txt", "r")
pageText = pageFile.read();
pageFile.close()

And then this

template_values = {
   'full_name': full_name,
   'notification': notification,
   'pageText': pageText
   }

   path = os.path.join(os.path.dirname(__file__), 'page.html')

When the page is rendered the pageText content does get inserted, but the Django template markup (like {{full_name}}) doesn’t get parsed. Which is my problem. I suspect the solution to this is to render the html file twice, once to load in the content and once to parse the Django template stuff, but I can’t find any resources about how to do this. Any help appreciated.

EDIT: specific view code

Instruction page

class Instruction(webapp.RequestHandler):
def get(self):

    checkUser(self)
    checkProfile(self)
    flowControl(self, 0)

    prepareHeader(self)

    global notification

    try:
        notification
    except NameError:
        notification = ""

    pageFile = open("instruction.txt", "r")
    pageText = pageFile.read();
    pageFile.close()

    template_values = {
        'url': url,
        'url_linktext': url_linktext,
        'user': user,
        'pageText': pageText,
        'footerText': footerText,
        'notification': notification
    }

    global instruction, refresh
    instruction = True
    refresh = True

    path = os.path.join(os.path.dirname(__file__), 'instruction.html')
    self.response.out.write(template.render(path, template_values))
  • 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-30T15:23:39+00:00Added an answer on May 30, 2026 at 3:23 pm

    You can use the Django include template tag. Or template inheritance.

    This example includes the contents of the template “foo/bar.html”:

    {% include "foo/bar.html" %}
    

    This example includes the contents of the template whose name is contained in the variable template_name:

    {% include template_name %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Python Google App Engine to simply fetch html pages and show it.
Are there any UI widgets available to the python side of Google App Engine?
On Google App Engine to query the data store with Python, one can use
The latest Google App Engine release supports a new Task Queue API in Python.
I'm using Google App Engine python. I want to know what browser the user
I am playing with Google App Engine and Python and I cannot list the
I am working with Google App Engine and Python. I have a model with
I'm working in the Google App Engine environment and programming in Python. I am
I have a Python Facebook project hosted on Google App Engine and use the
Are there any guidelines to writing Google App Engine Python code that would work

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.