Skip to main content

An extremely simple dynamic TemplateView for django

Project description

# Overview

An extremely simple django app that renders templates based on URL path.

Kenny provides a single view, `SongBirdView` which takes the path url kwarg
and appends .html to it and serves it. It also rstrips any `/`s. It can also
take an optional `prefix` kwarg that will be prepended to the redered
template's path.

`SongBirdView` is a subclass of `django.views.generic.base.TemplateView`, so
all of it's documentation except for the `template_name` parameter apply.

So basically, to serve the mockups of your website under the `/mockup/` URL
you can do the following:

```
urlpatterns += (
url(r'^mockup/(?P<path>.*)$', SongBirdView.as_view(prefix='mockup/'))
)
```

This way, if you go to `localhost:8000/mockup/foo/`, your `mockup/foo.html`
template will be served.

# Installation

As easy as

```
pip install django-kenny
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-kenny-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file django-kenny-0.1.0.tar.gz.

File metadata

  • Download URL: django-kenny-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-kenny-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9e4b64d65b05c4693cb7b06c5109250d698d56243bb0ef221116154e4259d04b
MD5 0ec4419fd6893b229d6625feb8f7b72c
BLAKE2b-256 b15ad83678259d6338c827b3b7262045f279ca6dc2b462c168aac61df9264b24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page