skip to navigation
skip to content

pyramid_fanstatic 0.5

pyramid tween for fanstatic


This package provide a Pyramid tween for fanstatic and a pyramid scaffold.


Just run:

$ pcreate -s starter -s pyramid_fanstatic myproject


$ pcreate -s pyramid_fanstatic myexistingproject

if you want to add pyramid_fanstatic to an existing project.


Fanstatic library definition is added to Resources are located in the resources/ directory.

Tween usage

You can use all fanstatic options in your .ini. You just need to prefix options with fanstatic.:

fanstatic.publisher_signature = fanstatic

You should add at least those two options:

fanstatic.bottom = true
fanstatic.debug = true # in development.ini

Then include pyramid_fanstatic in your


Base URLs for resources


By default, resource URLs from Fanstatic come served at in the script root and Fanstatic provides its base_url option to set a URL prefix for all resource URLs. You can utilise this option statically using the following:

fanstatic.base_url =

Take note that the URL should not have a trailing slash - Fanstatic has resources URLs that feature a / prefix already.


The above process works, but your application may need to serve from multiple URLs, multiple paths, and so forth. pyramid_fanstatic has a special option to allow the base_url prefix to be configured on a per-request basis. Your application URI is generated using wsgiref.util.application_uri and is based upon the request environment (according to PEP 333).

This option is fanstatic.use_application_uri and is specific to pyramid_fanstatic and is not passed to Fanstatic. Specify this option as follows:

fanstatic.use_application_uri = true

Any static base_url that is set will take precedence over this option.


0.6 (unreleased)

  • Nothing changed yet.

0.5 (2013-11-08)

  • Support fanstatic > 1.0 with backward compat

0.4 (2012-09-21)

  • Add new option fanstatic.use_application_uri to have Fanstatic base URLs generated using the current request. A base_url that is set will override this option. [davidjb]
  • Document details about Fanstatic base URLs and the fanstatic.base_url option. [davidjb]

0.3 (2011-12-27)

  • Improve the Pyramid scaffold that’s available with pcreate. [gawel]

0.2 (2011-12-26)

  • Forward requests to Pyramid handler if a resource can’t be found. [gawel]
  • Documentation and coverage improvements [gawel]

0.1 (2011-12-26)

  • Initial release. [gawel]
File Type Py Version Uploaded on Size (md5) Source 2013-11-08 12KB