-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from greyli/models
Update examples for chapter 5
- Loading branch information
Showing
444 changed files
with
50,998 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
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') |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.