Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example not working #17

Closed
wiltonsr opened this issue Feb 8, 2019 · 2 comments
Closed

Example not working #17

wiltonsr opened this issue Feb 8, 2019 · 2 comments

Comments

@wiltonsr
Copy link

wiltonsr commented Feb 8, 2019

I'm testing the example provided in README:

from flask import Flask, render_template
from flask_htmlmin import HTMLMIN
    
app = Flask(__name__)
app.config['MINIFY_PAGE'] = True

htmlmin = HTMLMIN(app)
# or you can use HTMLMIN.init_app(app)
# pass additional parameters to htmlmin
# HTMLMIN(app, **kwargs)

@app.route('/')
def main():
    # index.html will be minimized !!!
    return render_template('index.html')


@app.route('/exempt')
@htmlmin.exempt
def exempted_route():
    # index.html will be exempted and not blessed by holy htmlmin !!!
    return render_template('index.html')


if __name__ == '__main__':
    app.run()

And this is my templates/index.html

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>

  <body>
    <div>
      Hello
    </div>
    <div>
      World
    </div>
  </body>
</html>

I'm using python 3.7.2 and there is no minified output.

@wiltonsr wiltonsr closed this as completed Feb 8, 2019
@hamidfzm
Copy link
Owner

hamidfzm commented Feb 8, 2019

@wiltonsr What happened here???

@wiltonsr
Copy link
Author

Just a mistake. All is working fine.
Thanks @hamidfzm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants