Skip to main content

A simple rest api generator for django based on models

Project description

easyapi-django

A simple rest api generator for django based on models

API in 4 easy steps!

Install

pip install easyapi-django

Add middleware in Django settings

MIDDLEWARE = [
    ...
    'easyapi.ExceptionMiddleware',
]

Create Resource based on your model

from easyapi import BaseResource

from your_models import YOUR_DJANGO_MODEL

class ResourceName(BaseResource):
    model = YOUR_DJANGO_MODEL

Add to your routes url

from easyapi.routes import get_routes

from resourcefile import ResourceName

endpoints = {
    'endpointname(.\*)$': ResourceName,
}
routes = get_routes(endpoints)

urlpatterns = [
    ...
] + routes

Your api with GET, PUT, POST and DELETE is ready. Start using it

How easy and cool is that???

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

easyapi_django-0.0.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

easyapi_django-0.0.5-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file easyapi_django-0.0.5.tar.gz.

File metadata

  • Download URL: easyapi_django-0.0.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for easyapi_django-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9b1c02641b8f5108354ed18d8fa4356c713cc036cc4ba47e8f2816d66c845221
MD5 2587a1e2c11f83cd4b3ac062e0ec96d2
BLAKE2b-256 2edef6b30969e822e90e7dee65561a3d2c03a96d4674e9e52fd226dacd9f6784

See more details on using hashes here.

File details

Details for the file easyapi_django-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for easyapi_django-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 85cc0f81fcf1ea887cc9830f0aa5bbab59b57e5d8bda50337215fb6efff5d207
MD5 aed702c40b3c15ea64c76fb1b3ab0d2b
BLAKE2b-256 4f276e9f3f8430b4be17d2ee938461addd36b8c16415c14b54954ba96f7a7e99

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