- Notifications
You must be signed in to change notification settings - Fork8
Django Dynamic API - Open-Source Library | AppSeed
License
app-generator/django-dynamic-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Simple tool thatGenerates Secure APIs on top ofDRF with minimum effort - actively supported byApp-Generator.
- Dynamic API Features - video presentation
For acomplete set of features and long-term support, check outDynamic Django, a powerful starter that incorporates:
- Dynamic DataTables: using a single line of configuration, the data saved in any table is automatically managed
- Dynamic API: any model can become a secure API Endpoint using DRF
- Dynamic Charts: extract relevant charts without coding all major types are supported
- CSV Loader: translate CSV files into Django Models and (optional) load the information
- PowerfulCLI Tools for the GIT interface, configuration editing, updating the configuration and database (create models, migrate DB)
API engineprovided byDRFMinimal Configuration(single line in config for each model)Handles any modeldefined across the project
Step #1 -
Install the package
$ pip install django-dynamic-api// OR$ pip install git+https://github.com/app-generator/django-dynamic-api.git
Step #2 -
Update Configuration, include the new APPs
INSTALLED_APPS= ['django_dyn_api',# Django Dynamic API # <-- NEW'rest_framework',# Include DRF # <-- NEW'rest_framework.authtoken',# Include DRF Auth # <-- NEW]
Step #3 -
Register the modelincore/settings.py(DYNAMIC_API section)
This sample code assumes thatapp1 exists and modelBook is defined and migrated.
DYNAMIC_API= {# pattern:# API_SLUG -> Import_PATH'books' :"app1.models.Book",}REST_FRAMEWORK= {'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.SessionAuthentication','rest_framework.authentication.TokenAuthentication', ],}
Step #4 -
Migrate DBand create the tables used byDRF
$ python manage.py makemigrations$ python manage.py migrate
Step #5 -
Update routing, include APIs
fromdjango.contribimportadminfromdjango.urlsimportpath,include# <-- UPD: 'include` directivefromrest_framework.authtoken.viewsimportobtain_auth_token# <-- NEWurlpatterns= [path("admin/",admin.site.urls),path('',include('django_dyn_api.urls')),# <-- NEWpath('login/jwt/',view=obtain_auth_token),# <-- NEW]
Step #6 -
Use API
If the managed model isBooks, the API interface is/api/books/ and all CRUD methods are available.
Note: for mutating requests, the
JWT Tokenis provided byhttp://localhost:8000/login/jwt/route (the user should exist).
- DRF - HOMEpage
- MoreDeveloper Tools provided by
AppSeed - Ask forSupport via
Email&Discord
Django Dynamic API - Open-source library provided byApp-Generator
About
Django Dynamic API - Open-Source Library | AppSeed
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.

