Skip to main content

Camel case to snake case and snake case to camel case for Django REST framework

Project description

DRF Case Middleware

Camel case to snake case and snake case to camel case for Django REST framework.

Getting Started

$ pip install drf-case-middleware

Add the render and parser to your django settings file.

MIDDLEWARE = [
    # ... other middlewares
    'drf_case_middleware.middlewares.CaseMiddleware',
]

REST_FRAMEWORK = {

    'DEFAULT_RENDERER_CLASSES': (
        'drf_case_middleware.renders.CaseJSONRenderer',
        'drf_case_middleware.renders.CaseBrowsableAPIRenderer',
        # ... other renderers
    ),

    'DEFAULT_PARSER_CLASSES': (
        'drf_case_middleware.parsers.CaseFormParser',
        'drf_case_middleware.parsers.CaseMultiPartParser',
        'drf_case_middleware.parsers.CaseJSONParser',
        # ... other renderers
    ),
}

Note

This project is based on the djangorestframework-camel-case project.

License

MIT License

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

drf-case-middleware-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

drf_case_middleware-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file drf-case-middleware-0.1.2.tar.gz.

File metadata

  • Download URL: drf-case-middleware-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for drf-case-middleware-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8fe0196ea488edfb54d0fe5554a985707ade5da9e5e9be866b3db7f94cd5c942
MD5 da10dbe4187463f6f84e0d99d2dcb9b3
BLAKE2b-256 7fecf3093cd4c33c6084951a8452b32cbb88c20a031e4a654b6215ff570a79e1

See more details on using hashes here.

File details

Details for the file drf_case_middleware-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: drf_case_middleware-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for drf_case_middleware-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c07def3facaa68a00328b04bad9bf04595b2aaf76d6ba439fe9f68917998d5f4
MD5 a2ccb9bcf8cc704869705fb3a0951edc
BLAKE2b-256 20d9be2bd3da41bab5ed87cac11ca5a211a6ea82994a99bd7e8a3a961b1ea3f3

See more details on using hashes here.

Supported by

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