Questions tagged [flask-assets]

Flask-Assets is an extension for Flask, it helps with easy integration of webassets into a Flask app. Use this tag for related questions.

Flask-Assets is an extension for the framework. It allows one to easily integrate functionality into a Flask app. For more information visit its homepage.

48 questions
2
votes
1 answer

How do I pass libsass configuration variables into a flask_assets bundle?

My goal is to set LIBSASS_STYLE="expanded" via flask_assets.Bundle. The webassets libsass documentation says I can do it, but doesn't say how. My base app controller looks like the following. from flask import Flask, render_template from…
FinnM
  • 394
  • 1
  • 3
  • 17
2
votes
1 answer

Is flask-assets putting minified files in right directory?

I'm working to modify a cookiecutter Flask app. I'm working locally on WIN7 . I've set up bower to install the front end dependencies under the static root by using a .bowerrc file in the document root containing: { "directory" :…
user1592380
  • 34,265
  • 92
  • 284
  • 515
2
votes
2 answers

flask-assets - sass don't resolve relative path in @import scss directive

i have flask application with buildout environment ./bin/pip show flask | grep Version Version: 0.10.1 ./bin/pip show flask-assets | grep Version Version: 0.10 in src folder src/setup.py have following strings setup( name = 'spf', …
Slach
  • 1,672
  • 13
  • 21
2
votes
1 answer

Flask-Assets not working at all... = Insanity

I have simply tried setting up flask-assets (based on webassets), however just can't get it to work. I have the standard setup; python virtualenv pip to install the bare essentials (flask, flask-assets) sass ruby gem (for trying sass / scss) less…
SiNGH
  • 31
  • 1
  • 4
2
votes
1 answer

Tell Webassets not to minify some code

I am using Flask Assets which uses Webassets. It does a great job of stripping my HTML. However it strips whitespace in one area where I do not want whitespace to be stripped. Is there a way to tell webassets not to strip the whitespace from one…
Johnston
  • 20,196
  • 18
  • 72
  • 121
2
votes
1 answer

GAE: Flask/webassets throws an expection on {% extends "base.html" %}

I am trying to port my existing flask app into google app engine. After a lot of reading and solving issues, I came across a problem I am completely stuck with: Upon starting the app on my local environment, I get this error message: Short…
Houman
  • 64,245
  • 87
  • 278
  • 460
1
vote
2 answers

Writing custom filter in flask-assets (webassets)

Using Flask with flask-assets (from webassets) I wrote my own custom filter for a css compressor, following the documentation. It doesn't seem to work: from csscompressor import compress from flask_assets import Bundle from webassets.filter import…
Christian Macht
  • 456
  • 4
  • 20
1
vote
1 answer

OSError: [Errno 78] Function not implemented Flask-Assets

I get the following error when accessing a URL with Flask-Assets which is supposed to render and minify css. ERROR 2016-09-01 02:45:00,096 app.py:1587] Exception on /SomeFile [GET] Traceback (most recent call last): File…
Vinay Joseph
  • 5,515
  • 10
  • 54
  • 94
1
vote
1 answer

How to pass filter specific configuration options in webassets

Using flask, flask-assets, webassets I am trying to pass a filter specific configuration for a particular filter in webassets, but haven't been able to do so, so far. Have read the documentation multiple times to no avail. Have also gone through the…
bool.dev
  • 17,508
  • 5
  • 69
  • 93
1
vote
1 answer

Flask-Assets working locally but not on Heroku

I'm working to modify a cookiecutter Flask app. I'm working locally on WIN7 and attempting to deploy to heroku. I'm currently trying to add a datepicker to a page. I've found https://eonasdan.github.io/bootstrap-datetimepicker/. The structure of…
user1592380
  • 34,265
  • 92
  • 284
  • 515
1
vote
1 answer

How to use Flask assets to set cache for static files

I used Flask assets in my project to combine all js and css files. Its working perfectly. assets = Environment(app) js = Bundle('js/jquery/jquery.js','js/owl.carousel.min.js',output='gen/packed.js') assets.register('js_all', js) css =…
Tyler Durden
  • 93
  • 3
  • 9
1
vote
1 answer

Flask Assets only looking for change in one file

In my small flask app I have static/styles/ ├── base │   └── _variables.scss ├── components │   └── _header.scss ├── site.min.css ├── site.scss └── vendor ├── foundation In my base template I am using {% assets filters='compass,scss,cssmin',…
anthony-dandrea
  • 2,583
  • 7
  • 26
  • 46
0
votes
0 answers

Why is this scss code to select a random color from a list raising an error?

I am creating a web application using flask and am using flask_assets and pyscss to compile my scss. I am trying to give each section in the HTML a random color from a list using scss and this is what I have so far. The following scss code generates…
Suhana66
  • 25
  • 5
0
votes
0 answers

How to use flask_assets and then inline the bundle's content?

I am familiar with: create the bundle from flask_assets import Bundle bundles = { 'all_css': Bundle( '../dependency1.scss', '../dependency2.scss', filters=("libsass", "rcssmin"), output="css/my.min.css" …
101010
  • 14,866
  • 30
  • 95
  • 172
0
votes
0 answers

Is there a way to copy assets, without consolidating/filtering them using `flask-assets` or `webassets`?

I'm trying to consolidate all the random things we do in our project to make things work. This SO question is about copying image files and fonts from their node_modules source to the right location in our flask application. After a great deal of…
101010
  • 14,866
  • 30
  • 95
  • 172