-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathapp.py
51 lines (39 loc) · 1.21 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:url: http://greyli.com
:copyright: © 2019 Grey Li
:license: MIT, see LICENSE for more details.
"""
from flask import Flask, render_template
from flask_assets import Environment, Bundle
from flask_ckeditor import CKEditor
app = Flask(__name__)
app.secret_key = 'dev key'
assets = Environment(app)
ckeditor = CKEditor(app)
css = Bundle('css/bootstrap.min.css',
'css/bootstrap.css',
'css/dropzone.min.css',
'css/jquery.Jcrop.min.css',
'css/style.css',
filters='cssmin', output='gen/packed.css')
js = Bundle('js/jquery.min.js',
'js/popper.min.js',
'js/bootstrap.min.js',
'js/bootstrap.js',
'js/moment-with-locales.min.js',
'js/dropzone.min.js',
'js/jquery.Jcrop.min.js',
filters='jsmin', output='gen/packed.js')
assets.register('js_all', js)
assets.register('css_all', css)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/foo')
def unoptimized():
return render_template('unoptimized.html')
@app.route('/bar')
def optimized():
return render_template('optimized.html')