今天在学习flask时发现在python3.6中,导入flask.ext.wtf模块报错,错误如下:
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask.ext.wtf import Form
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'flask.ext'
上网搜索后发现,flask.ext.wtf模块的导入方法在3x版本中已经变成了
from flask_wtf import Form