Django API Forms

Go to CodeSee Map

Django Forms approach in processing of RESTful HTTP request payload (especially for content type like JSON or MessagePack) without HTML front-end.

Readme

Last 30 days:

3
Open issues
0
PRs opened
0
Contributors

Project type

First Timer FriendlyCode Framework

Project tech

Python

Currently seeking

  • Developers
  • Backend Developers
  • Designers
  • Maintainers
  • Technical Writers
  • Testers

Contribution overview

The maintainers of this project have not provided a contribution overview.

Overview

The main idea was to create a simple and declarative way to specify the format of expecting requests with the ability
to validate them. Firstly I tried to use Django Forms to
validate my API requests (I use pure Django in my APIs). I have encountered a problem with nesting my requests without
a huge boilerplate. Also, the whole HTML thing was pretty useless in my RESTful APIs.

I wanted to:

  • define my requests as object (Form),
  • pass the request to my defined object (form = Form.create_from_request(request)),
  • validate my request form.is_valid(),
  • extract data form.clean_data property.

I wanted to keep:

So I have decided to create a simple Python package to cover all my expectations.

Contributing

If you like nice diagrams you can also check repository
code map.

Feel free to open pull requests but please keep in mind this checklist:

  • write tests
  • write changes to to CHANGELOG.md
  • update README.md (if needed)
  • update documentation (if needed)

We use poetry for dependency management. Please write your source code according to the
PEP8 code-style. flake8 is used for
code-style and code-quality checks. Please, be sure that your IDE is following settings according to .editorconfig
file.

We use Django-style tests.

Documentation is places in docs directory and it's generated using
mkdocs-material. You can build docs calling poetry run mkdocs build.
Docs will be in sites directory after build. Documentation is updated after every push to origin/master branch
using GitHub Actions.

Learn

Resources to learn more about our technology and community.

Project listed on October 01, 2021