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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:23:19+00:00 2026-06-03T02:23:19+00:00

I keep receiving an internal server error – ‘BadValueError: Property content is required. It

  • 0

I keep receiving an internal server error – ‘BadValueError: Property content is required. It seems to happen when I pass blog_table into the template to render. Here’s the code:

main.py:

import os
import webapp2
import jinja2

from google.appengine.ext import db

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

class Handler(webapp2.RequestHandler):
    def write(self,*a,**kw):
        self.response.out.write(*a,**kw)

    def render_str(self,template,**params):
        t = jinja_env.get_template(template)
        return t.render(params)

    def render(self,template,**kw):
        self.write(self.render_str(template,**kw))

class Blog(db.Model):
    subject = db.StringProperty(required = True)
    content = db.TextProperty(required = True)
    created = db.DateTimeProperty(auto_now_add = True)

class MainPage(Handler):
    def render_front(self, subject="", content="", error=""):
        blog_table = db.GqlQuery("SELECT * FROM Blog ORDER BY created DESC")
        self.render("blog.html",subject = subject,content = content,error = error,blog_table = blog_table)

    def get(self):
        self.render_front()

    def post(self):
        subject = self.request.get("subject")
        content = self.request.get("content")

        if subject and content:
            b = Blog(subject = subject, content = content)
            b.put()
            self.redirect("/")

        else:
            error = "we need both a subject and some content"
            self.render_front(subject,content,error)

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

HTML:

<!DOCTYPE html>

<html>
    <head>
        <title>Blog</title>
    </head>
    <body>
        <h1>Blog</h1>

        <form method="post">
            <label>
                <div>Subject</div>
                <input type="text" name="subject" value="{{subject}}">
            </label>
            <label>
                <div>Content</div>
                <textarea name="content" value="{{content}}"></textarea>
            </label>
            <div class="error">{{error}}</div>
            <input type="submit">
        </form>

        <hr>
    {% for post in blog_table %}
        <div class="post">
            <div class="subject">{{post.subject}}</div>
            <pre class="content">{{post.content}}</pre>
        </div>
    {% endfor %}

    </body>
</html>

To see the error go to http://udacity-cs253-a31.appspot.com/

Thanks.

  • 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-03T02:23:22+00:00Added an answer on June 3, 2026 at 2:23 am

    This is just a guess – changed your Blog model and added the Content attribute recently.

    There’s some old instances of the Blog model in your datastore that have no Content. If you try to load those, your code fails. If you load a Blog instance with Content, everything is fine.

    You have to go through your datastore and ensure all instances of your Blog have Content.

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

Sidebar

Related Questions

I'm trying to implement my own GenericIdentity implementation but keep receiving the following error
I'm trying to mock MouseButtonEventArgs.GetPosition() with Moq, but I keep receiving this error: System.ArgumentException:
I am keep receiving this error on my magento pages in frontend and back-end.
I keep receiving a C2664 conversion error in visual studio It tells me that
I keep receiving the following error when attempting to unmarshall an xml document using
i am trying to set up form validation but keep receiving Parse error: syntax
I am not sure what the problem is but I keep receiving this error
I keep receiving this error (from the apache log) and I cannot get the
I keep on receiving this error and i don't know where this error occurs
Keep getting this error after inserting a subdatasheet into a query and trying to

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.