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.
Create Your django project.
Add easy_api in settings.py
INSTALLED_APPS = [ . . . ‘easy_api’ ]
Create your django app
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.
Migrate your models.
This is the last step. You need to add this model in your app’s urls.py
from django.urls import path from easy_api.models import EasyAPI from .models import MyModel
urlpatterns = [ path(“myurl/”, EasyAPI.as_view(), {“child_model”: MyModel}) ]
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:
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
Built Distribution
Hashes for django_model_api-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44386dee77226b3ff197fa63b33bff6efab4d3106b8cd2c428104676fd0febd8 |
|
MD5 | 1b2aec84950cf25c501ae16065759bd9 |
|
BLAKE2b-256 | 9fd2d004ea3ee13818f4466c9462ed10b931050e7cbfb586e3eb7d841f598962 |