flask-jade2underscore-0.1
توضیحات
A small Flask extension adds suppot to Jade2Underscore templates compiler (used in Backbone) to Flask.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | flask-jade2underscore-0.1 |
| نام | flask-jade2underscore |
| نسخه کتابخانه | 0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Manuel Albarran |
| ایمیل نویسنده | UNKNOWN |
| آدرس صفحه اصلی | https://github.com/weapp/flask-jade2underscore |
| آدرس اینترنتی | https://pypi.org/project/flask-jade2underscore/ |
| مجوز | MIT |
flask-jade2underscore
===============
A small Flask extension that makes it easy to use Jade to Underscore templates compiler (used in Backbone) with your Flask application.
Usage
-----
You can activate it by calling the ``jade2underscore`` function with your Flask app as a parameter:
from flaskext.jade2underscore import jade2underscore
jade2underscore(app, underscore_folder='underscore', jade_folder='src/jade')
This will intercept the request to ``underscore_folder`` and compile de file if is necesary using the files from ``jade_folder``.
When you deploy your app you might not want to accept the overhead of checking the modification time of your ``.jade`` and ``.tpl`` files on each request. A simple way to avoid this is wrapping the jade2underscore call in an if statement:
if app.debug:
from flaskext.jade2underscore import jade2underscore
jade2underscore(app)
If you do this you'll be responsible for rendering the ``.jade`` files into ``.tpl`` when you deploy in non-debug mode to your production server.
- documentation_
- development_
.. _documentation: https://github.com/weapp/flask-jade2underscore
.. _development: https://github.com/weapp/flask-jade2underscore
نحوه نصب
نصب پکیج whl flask-jade2underscore-0.1:
pip install flask-jade2underscore-0.1.whl
نصب پکیج tar.gz flask-jade2underscore-0.1:
pip install flask-jade2underscore-0.1.tar.gz