File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 9191
9292# Database
9393* .sqlite3
94+
95+ # Ignore collected static files
96+ static
Original file line number Diff line number Diff line change 11from flask_script import Manager
2+ from flask_collect import Collect
3+
24from tvseries import create_app
35from tvseries .config import DevelopmentConfig
46
57app = create_app (config = DevelopmentConfig )
68manager = Manager (app )
79
10+ collect = Collect ()
11+ collect .init_app (app )
12+
13+
14+ @manager .command
15+ def collect ():
16+ """Collect static from blueprints."""
17+ return app .extensions ['collect' ].collect ()
18+
819if __name__ == "__main__" :
920 manager .run ()
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ Flask-SQLAlchemy==2.1
44pytest-flask == 0.10.0
55python-decouple == 3.0
66uWSGI == 2.0.14
7+ Flask-Collect == 1.3.2
Original file line number Diff line number Diff line change 1+ import os
12from decouple import config
23
34
45class BaseConfig (object ):
6+ BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
57 SITE_NAME = 'Flask Tutorial'
68 SECRET_KEY = config ('SECRET_KEY' )
79 SERVER_NAME = config ('SERVER_NAME' )
810 SQLALCHEMY_DATABASE_URI = config ('DATABASE_URI' )
911 SQLALCHEMY_TRACK_MODIFICATIONS = True
12+ COLLECT_STATIC_ROOT = os .path .join (BASE_DIR , "static" )
13+ COLLECT_STORAGE = 'flask_collect.storage.file'
1014 DEBUG = False
1115 TESTING = False
1216
You can’t perform that action at this time.
0 commit comments