title: AttributeError: 'MainHandler' object has no attribute '_render_template'
body: <p>I have a question on Google App Engine (python). I can not find the problem, but it somehow does not work as expected. Error message is </p>
  
  <pre><code>self.response.out.write(self._render_template('main.html',template_context))
  AttributeError: 'MainHandler' object has no attribute '_render_template'
  </code></pre>
  
  <p>My code is below.What is the problem?</p>
  
  <pre><code>import webapp2
  import os
  import jinja2
  
  from google.appengine.api import users
  from models import Note
  
  jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(os.path.dirname(__file__)))
  
  class MainHandler(webapp2.RequestHandler):
  def get(self):
      user = users.get_current_user()
      if user is not None:
          logout_url = users.create_logout_url(self.request.uri)
          template_context = {
              'user':user.nickname(),
              'logout_url':logout_url,
          }
          def _render_template(self,template_name, context=None):
              if context is None:
                  context = {}
              template = jinja_env.get_template(template_name)
              return template.rendet(context)
          self.response.out.write(self._render_template('main.html',template_context))
  
      else:
          login_url = users.create_login_url(self.request.uri)
          self.redirect(login_url)
  def post(self):
      user = users.get_current_user()
      if user is None:
          self.error(401)
      note = Note(parent=ndb.Key("User",user.nickname()),title=self.request.get('title'),content=self.request.get('content'))
      note.put()
      logout_url = users.create_logout_url(self.request.uri)
      template_context = {
          'user': user.nickname(),
          'logout_url':logout_url,
      }
      template = jinja_env.get_template('main.html')
      self.response.out.write(template.render(template_context))
  
  app = webapp2.WSGIApplication([('/', MainHandler)], debug=True)
  </code></pre>
  
  <h2>Below is my yaml files.</h2>
  
  <pre><code>application: MYAPPLICATION
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: yes
  
  handlers:
  - url: /favicon\.ico
    static_files: favicon.ico
    upload: favicon\.ico
  
  - url: .*
    script: main.app
  
  libraries:
  - name: webapp2
    version: "2.5.2"
  - name: jinja2
  </code></pre>
  
  <h2>      version: latest</h2>