Hi, I'm trying to use Mako with `webapp2_extras`, but I get this error
everytime.
File
"/Users/sunandosamaddar/google_drive/py/webapp2_apps/hellowebapp2/main.py",
line 5, in <module>
from webapp2_extras import mako
File
"/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.3/webapp2_extras/mako.py"
, line 15, in <module>
from mako import lookup
ImportError: No module named mako
*main.py*
```
#import cgi
#from google.appengine.api import users
import webapp2
from webapp2_extras import mako
mako.default_config = {'template_path': 'server/views'}
class BaseHandler(webapp2.RequestHandler):
def get(self):
@webapp2.cached_property
def mako(self):
# Returns a Mako renderer cached in the app registry.
return mako.get_mako(factory=mako.Mako(app=self.app, config=None), registry=
'webapp2_extras.mako.Mako', app=self.app)
def render_response(self, _template, **context):
# Renders a template and writes the result to the response.
rv = self.mako.render_template(_template, **context)
self.response.write(rv)
class HomeHandler(BaseHandler):
def get(self):
self.render_response('home.html', **context)
app = webapp2.WSGIApplication([('/', HomeHandler)], debug=True)
```
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/0580f745-b519-464a-bb2c-213b79121f26%40googlegroups.com.