Skip to main content

Unrest Schema

A library for converting Django forms to json schema endpoints

Usage

First install with pip install unrest_schema and then register any form:

from django import forms
from unrest_schema import register

from myapp.models import MyModel

@register
class MyModelForm(forms.ModelForm):
    class Meta:
        model = MyModel
        fields = ('field1', ...)

Then, in your urls add a the urls for unrest_schema

from django.urls import include

urlpatterns = [
    ..., #other url patterns
    re_path('', include('unrest_schema.urls')),
]

Now visit /api/schema/MyModelForm/ in a browser to get the json representation of MyModelForm. Additionally you can post to /api/schema/MyModelForm/ to create a new MyModel instance or /api/schema/MyModelForm/1/ to modify the MyModel instance with id=1.

Contributing/follow up

Feel free to open a github issue if you want to suggest any features or ask for help. Additionally, the python code for this project is ~150 lines so don't be afraid to dig in!

Metadata

Release files for unrest-schema 0.1.1

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

Source distribution (sdist)

Source distribution for unrest-schema 0.1.1
File Size Uploaded Provenance
unrest_schema-0.1.1.tar.gz 3.7 kB Without provenance Details

Release files / unrest_schema-0.1.1.tar.gz

Download URL unrest_schema-0.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
21f67292202d62e1d422b2e5a11ecb07333c246fc00f7c372b7f6da3aa6bbbba
BLAKE2b-256 checksum
How to use checksums
587411d8289a4db5d55c836020387a64bb4d1a95494acb9e91036f80a63af44c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.17

Security for unrest-schema 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

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