lixxu/flask-tabler

a collection of Jinja macros for tabler and Flask

★ 0Forks 0HTMLGitHub ↗Compare

README

flask-tabler

flask-tabler is a collection of Jinja macros for tabler and Flask.

Installation

pip install -U flask-tabler

Example

Register the extension:

from flask import Flask
from flask_tabler import Tabler

app = Flask(__name__)
tabler = Tabler(app)

Assuming you have a Flask-WTF form like this:

class LoginForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired(), Length(1, 20)])
    password = PasswordField('Password', validators=[DataRequired(), Length(8, 150)])
    remember = BooleanField('Remember me')
    submit = SubmitField()

Now with the render_form macro:

{% from 'helpers/form.html' import render_form %}
<html>
  <head>
    <!-- css area -->
  </head>
  <body>
    <h2>Login</h2>
    {{ render_form(form) }}

    <!-- js area -->
  </body>
</html>

Contributors

lixxu

Issues