File tree Expand file tree Collapse file tree 8 files changed +82
-73
lines changed Expand file tree Collapse file tree 8 files changed +82
-73
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,20 @@ url = "https://pypi.org/simple"
44verify_ssl = true
55
66[dev-packages ]
7- python-dotenv = " *"
8- lesscpy = " *"
9- cssmin = " *"
10- jsmin = " *"
7+ python-dotenv = " *"
8+ lesscpy = " *"
9+ cssmin = " *"
10+ jsmin = " *"
1111
1212[packages ]
13- flask = " *"
14- flask_assets = " *"
15- pathlib = " *"
16- dash = " *"
17- dash_core_components = " *"
18- dash_html_components = " *"
19- dash -renderer= " *"
20- pandas = " *"
13+ Flask = " *"
14+ Flask_assets = " *"
15+ Pathlib = " *"
16+ Dash = " *"
17+ Dash_core_components = " *"
18+ Dash_html_components = " *"
19+ Dash -renderer = " *"
20+ Pandas = " *"
2121
2222[requires ]
2323python_version = " 3.7"
Original file line number Diff line number Diff line change 55![ Flask] ( https://img.shields.io/badge/Flask-1.0.2-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
66![ Flask-Assets] ( https://img.shields.io/badge/Flask--Assets-v0.12-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
77![ Pandas] ( https://img.shields.io/badge/Pandas-v0.24.2-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
8- ![ Dash] ( https://img.shields.io/badge/Dash-v0.40.0 -blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
8+ ![ Dash] ( https://img.shields.io/badge/Dash-v1.0.2 -blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
99![ Plotly] ( https://img.shields.io/badge/Plotly-v3.7.1-blue.svg?longCache=true&logo=python&longCache=true&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a )
1010![ Psycopg2-Binary] ( https://img.shields.io/badge/Psycopg2--Binary-v2.7.7-red.svg?longCache=true&style=flat-square&logo=PostgreSQL&logoColor=white&colorA=4c566a&colorB=bf616a )
1111![ Flask-SQLAlchemy] ( https://img.shields.io/badge/Flask--SQLAlchemy-2.3.2-red.svg?longCache=true&style=flat-square&logo=scala&logoColor=white&colorA=4c566a&colorB=bf616a )
Original file line number Diff line number Diff line change @@ -18,4 +18,8 @@ def create_app():
1818 from .dash_application import dash_example
1919 app = dash_example .Add_Dash (app )
2020
21+ # Compile assets
22+ from .assets import compile_assets
23+ compile_assets (app )
24+
2125 return app
Original file line number Diff line number Diff line change 1+ from flask_assets import Environment , Bundle
2+
3+
4+ def compile_assets (app ):
5+ """Configure authorization asset bundles."""
6+ assets = Environment (app )
7+ Environment .auto_build = True
8+ Environment .debug = False
9+ less_bundle = Bundle ('less/*.less' ,
10+ filters = 'less,cssmin' ,
11+ output = 'dist/css/styles.css' ,
12+ extra = {'rel' : 'stylesheet/less' })
13+ js_bundle = Bundle ('js/*.js' ,
14+ filters = 'jsmin' ,
15+ output = 'dist/js/main.js' )
16+ assets .register ('less_all' , less_bundle )
17+ assets .register ('js_all' , js_bundle )
18+ if app .config ['FLASK_ENV' ] == 'development' :
19+ less_bundle .build (force = True )
20+ js_bundle .build ()
Original file line number Diff line number Diff line change 11"""Create a Dash app within a Flask app."""
2- import glob
32from pathlib import Path
43from dash import Dash
54import dash_table
@@ -43,7 +42,8 @@ def get_datasets():
4342 id = 'table_' + str (index ),
4443 columns = [{"name" : i , "id" : i } for i in df .columns ],
4544 data = df .to_dict ("rows" ),
46- sorting = True ,
45+ sort_action = "native" ,
46+ sort_mode = 'single'
4747 )
4848 arr .append (table_preview )
4949 return arr
Original file line number Diff line number Diff line change 11"""Routes for core Flask app."""
22from flask import Blueprint , render_template
3- from flask_assets import Environment , Bundle
43from flask import current_app as app
54
5+
66main_bp = Blueprint ('main_bp' , __name__ ,
77 template_folder = 'templates' ,
88 static_folder = 'static' )
9- assets = Environment (app )
10- Environment .auto_build = True
11- Environment .debug = False
12- less_bundle = Bundle ('less/*.less' ,
13- filters = 'less,cssmin' ,
14- output = 'dist/css/styles.css' ,
15- extra = {'rel' : 'stylesheet/less' })
16- js_bundle = Bundle ('js/*.js' ,
17- filters = 'jsmin' ,
18- output = 'dist/js/main.js' )
19- assets .register ('less_all' , less_bundle )
20- assets .register ('js_all' , js_bundle )
21- if app .config ['FLASK_ENV' ] == 'development' :
22- less_bundle .build (force = True )
23- js_bundle .build ()
249
2510
2611@main_bp .route ('/' )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ attrs==19.1.0
22certifi == 2019.3.9
33chardet == 3.0.4
44Click == 7.0
5+ cssmin == 0.2.0
56dash == 1.0.2
67dash-core-components == 1.0.0
78dash-html-components == 1.0.0
@@ -15,18 +16,22 @@ idna==2.8
1516ipython-genutils == 0.2.0
1617itsdangerous == 1.1.0
1718Jinja2 == 2.10.1
19+ jsmin == 2.2.2
1820jsonschema == 3.0.1
1921jupyter-core == 4.4.0
22+ lesscpy == 0.13.0
2023MarkupSafe == 1.1.1
2124nbformat == 4.4.0
22- numpy == 1.16.4
25+ numpy == 1.17.0
2326pandas == 0.25.0
2427pathlib == 1.0.1
2528plotly == 4.0.0
29+ ply == 3.11
2630pyrsistent == 0.15.2
2731python-dateutil == 2.8.0
28- pytz == 2019.1
29- PyYAML == 5.1.1
32+ python-dotenv == 0.10.3
33+ pytz == 2019.2
34+ PyYAML == 5.1.2
3035requests == 2.21.0
3136retrying == 1.3.3
3237six == 1.12.0
You can’t perform that action at this time.
0 commit comments