Skip to main content
Pyramid helper to create restful route.

Using URL Dispatch and class base view.


At pyramid booststrap

```
def main(global_config, **settings):
config = Configurator(settings=settings)
config.include("pyramid_resources")
```

Registering route with `AppView`
```
config.add_rest_route('app', 'apps', AppView,
members={
'basic': 'edit',
'messaging': 'view',
'admin': 'edit',
},
collections={
'paid': 'admin',
},
factory=RootFactory)

```

A simple `AppView` implementation

```
class AppView(RestView):

renderers = {
'basic': '/app/basic.mako'
}

def basic(self):
return {
'location': 'Render at basic.mako'
}

@view_config(
route_name='paid_app',
renderer='json',
custom_predicates=(allowed_extension(*['.json']),)
permission='read')
def paid(self):
return {
"message": "using json renderer on json extension"
}


```

Release files for pyramid_rest_route 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramid_rest_route 0.2
File Size Uploaded
pyramid_rest_route-0.2.tar.gz 3.2 kB Details

Release files / pyramid_rest_route-0.2.tar.gz

Download URL pyramid_rest_route-0.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b912688578bfd23636e26463d23a03b36c13df4286c718e529a40d43024ba87e
BLAKE2b-256 checksum
How to use checksums
b9f7d5def3b230446da6d5c97db8dc489232f567dc0a4dfcd8b0e4ade40b50ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page