Skip to content
Snippets Groups Projects
Commit 914e74b3 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add whitenoise to serve static files

parent 31d06deb
No related branches found
Tags 0.27.1
No related merge requests found
......@@ -11,6 +11,7 @@ Create the WSGI application.
"""
import sqlalchemy as sa
from flask import Flask
from whitenoise import WhiteNoise
from . import settings
from .extensions import db, migrate, login_manager, ldap_manager, bootstrap, admin, mail, jwt
from .models import Action, Manufacturer, Model, Location, Status
......@@ -103,6 +104,12 @@ def create_app(config=None):
app.register_blueprint(users)
app.register_blueprint(api, url_prefix='/api')
app.wsgi_app = WhiteNoise(app.wsgi_app, root='static/')
app.wsgi_app.add_files(
root='/opt/conda/envs/inventory/lib/python3.6/site-packages/flask_bootstrap/static/',
prefix='bootstrap/'
)
register_cli(app)
return app
......@@ -42,6 +42,7 @@ dependencies:
- conda-forge::tk=8.5.19=1
- conda-forge::werkzeug=0.12.2=py36_0
- conda-forge::wheel=0.29.0=py36_0
- conda-forge::whitenoise=3.3.0=py36_0
- conda-forge::wtforms=2.1=py36_0
- conda-forge::xz=5.2.2=0
- conda-forge::zlib=1.2.11=0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment