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