Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (57 sloc) 2.74 KB



Install using easy_install or pip

$ easy_install pyramid_assetviews


pyramid_assetviews is a small module that allows you to add Root-Relative views to your project. This enables you to serve assets that need to be accessed from the root of your domain such as robots.txt or favicon.ico without having to setup a static media server such as nginx or lighttpd. (Although in all fairness it's probably not preferable to serve static media from your application and rather use a static media server instead.)


To use pyramid_assetviews you simply include it in your applications config like so:

Adding this to your Pyramid config will add the add_asset_views directive to the config object. Static assets may subsequently be added to your config by using this new directive. For example:

Optionally you may use the http_cache argument to specify the time in seconds that the file should remained cached. If you need to specify cache settings per file you will have to call add_asset_views multiple times instead of using the filenames argument.