Skip to main content
A helper function for creating views from a YAML file of URL paths
==================================================================

Installation
------------

.. code:: bash

pip install canonicalwebteam.views-from-yaml

Usage
-----

E.g. create a YAML file:

.. code:: yaml
# url-settings.yaml
some/url/path: {"content": "Hello world!"}
another/path: {"content": "Different content"}

And edit your Django app's ``urls.py``\:

.. code:: python

# django_app/urls.py

from canonicalwebteam.views_from_yaml import load_views_from_file

def url_view(request, url_settings):
return HttpResponse(url_settings['content'])

urlpatterns = load_views_from_file(
yaml_filepath="url-settings.yaml",
view_callback=url_view
)

Now if you visit `http://your-django-site/some/url/path` you should see
"Hello world!".

Metadata

Release files for canonicalwebteam.views-from-yaml 0.2.3

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

Source distribution (sdist)

Source distribution for canonicalwebteam.views-from-yaml 0.2.3
File Size Uploaded Provenance Actions
canonicalwebteam.views-from-yaml-0.2.3.tar.gz 1.9 kB Without provenance Details for canonicalwebteam.views-from-yaml-0.2.3.tar.gz

Release files / canonicalwebteam.views-from-yaml-0.2.3.tar.gz

Download URL canonicalwebteam.views-from-yaml-0.2.3.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
40be74fd53056be59e2ab5286c36b4cba3d9085f37c228075e4d0b3467e5daea
BLAKE2b-256 checksum
How to use checksums
531275d06da0cb89ea038e9cd36c97aa03e083c9e4098935e4bf298c5b06b0af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for canonicalwebteam.views-from-yaml 0.2.3

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.

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