pyramid_fanstatic
This package provide a Pyramid tween for fanstatic and a pyramid scaffold.
Scaffold
Just run:
$ pcreate -s starter -s pyramid_fanstatic myproject
Or:
$ pcreate -s pyramid_fanstatic myexistingproject
if you want to add pyramid_fanstatic to an existing project.
Then read README_FANSTATIC.txt
Fanstatic library definition is added to resources.py. 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.:
[app:main] ... 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 __init__.py:
config.include('pyramid_fanstatic')
Base URLs for resources
Static
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:
[app:main] ... fanstatic.base_url = https://example.com/myapp
Take note that the URL should not have a trailing slash - Fanstatic has resources URLs that feature a / prefix already.
Dynamic
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:
[app:main] ... fanstatic.use_application_uri = true
Any static base_url that is set will take precedence over this option.
Changelog
0.6 (2020-06-16)
Features
Add support for Python 3.7 and 3.8. [sallner, gotcha]
Other
Remove zc.buildout and nosetest infratructure in favour of tox and pytest.
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]
Metadata
Release files for pyramid-fanstatic 0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyramid_fanstatic-0.6.tar.gz | 9.0 kB | Without provenance | Details for pyramid_fanstatic-0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyramid_fanstatic-0.6-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for pyramid_fanstatic-0.6-py2.py3-none-any.whl |
Total release size: 17.7 kB
Release files / pyramid_fanstatic-0.6.tar.gz
| Download URL | pyramid_fanstatic-0.6.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
791163e51935bbc1a9eb271c869b7b56fb8eff09d534ecfb4a6160160f885763
|
|
BLAKE2b-256 checksum How to use checksums |
56c87a0c1e2c2c02fa847be8d384e2e8a0e7e4a52c8db14ad3720f96beaa2c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.3
|
Release files / pyramid_fanstatic-0.6-py2.py3-none-any.whl
| Download URL | pyramid_fanstatic-0.6-py2.py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4dad88f775381f5afa158db0f9a0c64568ae086443af3029a26a595c8b685073
|
|
BLAKE2b-256 checksum How to use checksums |
75d84e7eb6eb9cab281e2ecaae68337ebf32b48397a2f88c458e96ee632a3d8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.3
|
Security for pyramid-fanstatic 0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.