Reputation: 1
so i am trying webapp2 first time with jinja2. Here is my code
import os
import jinja2
import webapp2
from jinja2 import Environment, PackageLoader, select_autoescape
JINJA_ENVIROMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader('templates'),
autoescape = select_autoescape()
)
jinja_var = {
'title': 'this is a test content page'
}
class MainHandler(webapp2.RequestHandler):
def appear_template(self):
template = JINJA_ENVIROMENT.get_template('index.html')
self.response.write(template.render(jinja_var))
app = webapp2.WSGIApplication([
('/.*', MainHandler),
], debug=True)
and i get this error
Traceback (most recent call last):
File "c:\Users\unfge\Desktop\ProjectW\main.py", line 4, in <module>
import webapp2
File "C:\Users\unfge\Desktop\ProjectW\wdi\lib\site-packages\webapp2.py", line 571
except Exception, e:
^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
I do not know what the problem is since i am new to this. I would appreciate any help
Upvotes: 0
Views: 1153