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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:26:47+00:00 2026-05-15T11:26:47+00:00

I got the following very basic template: <html> <head> </head> <body> <div> <!– Using

  • 0

I got the following very basic template:

<html>
<head>
</head>
<body>

<div>
<!-- Using "for" to iterate through potential pages would prevent getting empty strings even if only one page is returned because the "page" is not equal the query, it is a subcomponent of the query -->
<div>{{ page.name }}</div>
<div>{{ page.leftText }}</div>
<div>{{ page.imageURL }}</div>
<div>{{ page.rightText }}</div>
</div>

</body>
</html>

And the very basic Model:

class Page(db.Model):
 name = db.StringProperty(required=True)
 leftText = db.TextProperty()
 rightText = db.TextProperty()
 imageURL = db.LinkProperty()

And the very basic Handlers:

class BaseRequestHandler(webapp.RequestHandler):
    #######
class PageContentLoadRequestHandler(BaseRequestHandler):

 def renderPage(self, values):
  directory = os.path.dirname(__file__)
  path = os.path.join(directory, 'templates', 'simple_page.html')
  return template.render(path, values, True)

 def get(self):
  page = db.get('aghwc21vZWJlbHIKCxIEUGFnZRgBDA')
            #alternative code
            # page db.get(db.key(self.request.get('key')))
            # The solution is to call/fetch the wanted object/query
  data = page.get() # or ... = Page.gql("GQL CODE").fetch(1)
  values = {'page': page}
  template_name = "simple_page.html"
  return self.response.out.write(self.renderPage(values))

The key is just randomly taken out of my storage, it is a real existing key of a filled entity.
They idea is to load a page content dynamically into the doc via AJAX, problem is, that this handler returns an empty template.
No ERRORS, 200 HTTP Code, key exists etc, etc, etc.
I am totally broken and a bit annoyed, by such problems, because I quiet do not know where the fault could be.

regards,

EDIT: Changing the template values to there correct names, I now get the following erro:

    values = {'page': page, 'name': page.name,}
AttributeError: 'NoneType' object has no attribute 'name'
  • 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-15T11:26:48+00:00Added an answer on May 15, 2026 at 11:26 am

    Your properties are called ‘leftText’, ‘rightText’, and ‘imageURL’, but you’re trying to print out ‘left_text’, ‘right_text’ and ‘image_url’. Django, in its infinite wisdom, simply returns an empty string when you try to access a property that doesn’t exist, rather than throwing an exception.

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

Sidebar

Related Questions

I've got a very basic application that boils down to the following code: char*
I have got the following very simple code: function init() { var articleTabs =
Recently I've spotted a very disturbing issue. I've got the following python code: for
I have got following html <a disabled=disabled><img alt=First src=/Content/Images/Grid/disabledFirst.png></a> And I run following expect
I'm encountering a very strange problem using g++ 4.1.2. I have a very basic
I have the following very simple regex, which matches HTML tags in a string.
I've got, probably, a very basic question about sessions. In the page load function
I have the following very basic stored procedure: CREATE PROCEDURE [dbo].[GetNumberToProcess] AS RETURN 999
to make it simple, i've got following code: <div> <a>view all your links</a> </div>
I am using WindowAzure cloud computing API. I am developing a very basic application

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.