本文整理汇总了Python中flask_assets.Environment.versions方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.versions方法的具体用法?Python Environment.versions怎么用?Python Environment.versions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask_assets.Environment
的用法示例。
在下文中一共展示了Environment.versions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Bundle
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import versions [as 别名]
'vendor/js/esri-leaflet.js'
),
Bundle(
'portal_ui/js/generalMapping.js',
'portal_ui/js/providerSitesMap.js',
'portal_ui/js/providerSitesMapOnReady.js'
),
filters='jsmin',
output='gen/sitesMap.js'),
'site_map': Bundle(
Bundle(
'vendor/js/leaflet.js',
'vendor/js/leaflet-providers.js',
'vendor/js/leaflet.markercluster.js',
'vendor/js/esri-leaflet.js'
),
Bundle(
'portal_ui/js/generalMapping.js',
'portal_ui/js/providerSiteMap.js',
'portal_ui/js/nldiMapping.js',
'portal_ui/js/providerSiteMapOnReady.js'
),
filters='jsmin',
output='gen/siteMap.js')
}
assets = Environment(app)
assets.versions = 'hash'
assets.register(bundles)
示例2: SQLAlchemy
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import versions [as 别名]
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.register_blueprint(API)
db = SQLAlchemy(app)
app.config.from_pyfile('apihoyodecrimen.cfg')
# report exceptions to sentry.io
# first test if sentry.io is in the string
# to see if we are in the testing environment
if 'sentry.io' in os.environ['SENTRY_DSN']:
sentry = Sentry(dsn= os.environ['SENTRY_DSN'])
sentry.init_app(app)
cache.init_app(app)
assets = Environment(app)
assets.versions = 'hash' # use the last modified timestamp
babel = Babel(app)
#freezer = Freezer(app)
#app.config['FREEZER_STATIC_IGNORE'] = ['/api/v1/*']
def uglify(route_function):
@functools.wraps(route_function)
def wrapped(*args, **kwargs):
yielded_html = route_function(*args, **kwargs)
minified_html = minify(yielded_html)
return minified_html
return wrapped
示例3: Flask
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import versions [as 别名]
elif current_line is not None:
current_line += line
log.reverse()
return log
# Create web server and load settings
app = Flask(__name__, static_url_path='')
app.config.from_object('default_settings')
app.config.from_pyfile('settings.cfg', silent=True)
# Assets plugin creates optimized javascript and css files
# to improve page load a bit
assets = Environment(app)
assets.versions = 'timestamp'
# Optimize Main javascript files
js_assets = Bundle(
'vendor/js/jquery.js',
'vendor/js/jquery.flot.js',
'vendor/js/jquery.flot.axislabels.js',
'vendor/js/jquery.flot.time.js',
'vendor/js/jquery.flot.tooltip.js',
'vendor/js/jquery.flot.downsample.js',
'vendor/js/select2.js',
'vendor/js/bootstrap-button.js',
'vendor/js/bootstrap-datepicker.js',
filters='rjsmin',
output='js/min.js')