0
我试图测试烧瓶编辑包(https://github.com/nathancahill/Flask-Edits)烧瓶编辑:AttributeError的:“的TokenStream”对象有没有属性“下一个”
任何人都可以与此错误的帮助:AttributeError的:“的TokenStream”对象有没有属性 '下一个'
@app.route('/')
def hello_world():
return render_template('test.html')
if __name__ == '__main__':
app.run(debug=True)
模板:
<!DOCTYPE html>
<html>
<head>
<title>Haldane</title>
</head>
<body>
<p>Test</p>
{% editable 'Section name' %}
Python is a programming language that lets you work quickly and integrate systems more effectively.
{% endeditable %}
</body>
</html>
出现的错误在这里:
"""Jinja extensions to mark sections as editable
"""
import hashlib
from collections import OrderedDict
from jinja2.nodes import Output, Template, TemplateData
from jinja2.ext import Extension
class EditableExtension(Extension):
tags = set(['editable'])
def parse(self, parser):
_db = self.environment.edits
# Skip begining node
parser.stream.next()
错误:
File "/anaconda/lib/python3.5/site-packages/flask_edits/editable.py", line 18, in parse
parser.stream.next()
AttributeError: 'TokenStream' object has no attribute 'next'
主旨包括代码: https://gist.github.com/archienorman11/98993d66fc30283ba113f8a4f2b39669