Skip to main content

Create model based api without any extra code.

Project description

# django-easy-api

Now there is no need to create apis for common CRUD operation for any model. By using django-easy-api its really easy. Kindly follow the below steps for including this library into your project.

  1. Create Your django project.

  2. Add easy_api in settings.py

    INSTALLED_APPS = [ . . . ‘easy_api’ ]

  3. Create your django app

  4. Now in models.py follow create your model by inheriting EasyAPI model from easy_api app.

    from django.db import models from easy_api.models import EasyAPI

    class MyModel(EasyAPI):

    # Your Requried field here.

  5. Migrate your models.

  6. This is the last step. You need to add this model in your app’s urls.py

    from django.urls import path from .models import MyModel

    urlpatterns = [

    path(‘myurl/’, MyModel.as_view()),

    ]

7. That’s it. Now you will have common GET/POST/PUT/DELETE methods on your model. Also you can attach query_params only for id in your url. For example:

http://localhost:8000/myurl/?id=1

8. You can also override get, post, put and delete method according to your need. For example:

from django.db import models from easy_api.models import EasyAPI

class MyModel(EasyAPI):

# Your Requried field here.

def get(self, request):

#Your logic

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_model_api-1.4-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

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