Skip to content
Integrates Webassets into Morepath.
Python Other
  1. Python 99.6%
  2. Other 0.4%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


More Webassets

An opinionated Webassets integration for Morepath.

Webassets | Morepath

This package is somewhat similar to more.static, which integrates bowerstatic into Morepath. It is currently not really used anywhere, so you should probably stick to more.static.

Now that you are sufficently discouraged from using more.webassets, these are the reasons it might be for you:

  • You don't have to learn about javascript package managers (i.e. Bower).
  • You can have your assets compiled on the fly.
  • Your stylesheets are rendered at the top, your scripts at the bottom. No configuration necessary.

If you are alreay familiar with webassets: This package might not be as powerful as you're used to. It currently has little flexibility. It's also the first time the author uses webassets, so things might be off.

If you're using Webassets differently than me and you want your ways to work with more.webassets, do open an issue. I'm happy to turn this into something more powerful.


The following app serves a minified jquery from assets/js/jquery.js (relative to the code):

from more.webassets import WebassetsApp

class App(WebassetsApp):

def get_asset_path():
    return 'assets/js'

def get_output_path():
    return 'assets/bundles'

def get_js_filter():
    return 'rjsmin'

def get_jquery_asset():
    yield 'jquery.js'

class Root(object):

def index(self, request):

    return '<html><head></head><body>hello</body></html>'

This will result in the following html (formatted for readability):

        <script type="text/javascript" src="./assets/jquery.bundle.js?1234"></script>

For it to work you need an 'assets/js' folder with a 'jquery.js' file in the same folder as your python file where 'MyApp' is defined.

Debug Mode

To activate webassets debug mode use the following environment variable:



Most documentation is currently found in source code. Have a look at the comments in the directives file.

Run the Tests

Install tox and run it:

pip install tox

Limit the tests to a specific python version:

tox -e py27


More Webassets follows PEP8 as close as possible. To test for it run:

tox -e pep8

More Webassets uses Semantic Versioning

Build Status

Build Status


Project Coverage

Latests PyPI Release

Latest PyPI Release


more.webassets is released under the revised BSD license

You can’t perform that action at this time.