Plaster-pastedeploy provides a `plaster` loader that understands `PasteDeploy` configuration files, primarily used for loading WSGI applications and server configurations from INI-style files. It is currently at version 1.0.1. Its release cadence is generally stable and aligns with major `plaster` and `PasteDeploy` releases.
pip install plaster-pastedeployVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `plaster-pastedeploy` to load a WSGI application and server configuration from a `PasteDeploy`-style `.ini` file using the `plaster` API. Importing `plaster_pastedeploy` ensures that `plaster` can correctly parse URIs starting with `config:` that point to `PasteDeploy` configurations. For this example to fully run without errors regarding egg specs, `webtest-app` and `waitress` would need to be installed.
Ensure `import plaster_pastedeploy` is placed at the top of your module or prior to any `plaster.parse_uri` calls.
Ensure all packages referenced in your `use = egg:spec` directives within the .ini file are installed in your environment (e.g., `pip install webtest-app waitress`).
When upgrading, ensure both `plaster` and `plaster-pastedeploy` are at compatible 1.x versions (e.g., `pip install 'plaster>=1.0' 'plaster-pastedeploy>=1.0'`). Review `plaster`'s migration guide if moving from 0.x.
Ensure your INI file contains a section like `[app:main]` with a correctly defined application factory. If your application section has a different name (e.g., `[app:myapp]`), specify it when calling the loader methods.
```ini
[app:main]
use = call:my_package.module:app_factory
# ... other app settings
```
```python
# If your section is [app:myapp]
loader.get_wsgi_app('myapp')
```Install the library using pip: ```bash pip install plaster-pastedeploy ```
Verify that a section named `[app:main]` exists in your PasteDeploy INI file if you intend to load the default application, or explicitly specify the correct section name in your loader calls if it's different. If the error occurs when accessing loaded settings, check the structure of the dictionary returned to ensure the 'main' key is present.
```ini
# In your .ini file, ensure a 'main' app section exists
[app:main]
# ... configuration for the main application
```
```python
# Or specify the correct section name
settings = loader.get_settings('my_other_section')
```