Search code examples
pythonflaskmisaka

How to solve flask.ext error


I am building a markdown blogging with flask app. here is my code:

from flask import Flask, render_template
from flask.ext.misaka import Misaka

app = Flask(__name__, template_folder="views")
Misaka(app)

content = ""
with open('readme.md', 'r') as f:
    content = f.read()

@app.route("/")
def index():
    return render_template('index.html', text=content)

if __name__ == "__main__":
    app.run(debug=True)

I have installed pip3 install Flask-Misaka. After installing also it is giving me error that:

Traceback (most recent call last):
  File "blog.py", line 2, in <module>
    from flask.ext.misaka import Misaka
ModuleNotFoundError: No module named 'flask.ext'

I am not using any virtual environment, and working in fedora27. does anyone have any idea regarding this.


Solution

  • Instead of flask.ext use flask_:

    from flask_misaka import Misaka