Django API generator over DRF
Project description
Django API Generator
The tool is able to generate APIs
using Django & DRF stack with a minimum effort.
Actively supported by AppSeed via
Discord
.
How to use it
Step #1 - Install the package via
PIP
$ pip install django-api-generator
// OR
$ pip install git+https://github.com/app-generator/django-api-generator.git
Step #2 Update Configuration, include the new APP
INSTALLED_APPS = [
'django_api_gen', # Django API GENERATOR # <-- NEW
'rest_framework', # Include DRF # <-- NEW
'rest_framework.authtoken', # Include DRF Auth # <-- NEW
]
Step #3 -
Register the model
incore/settings.py
(API_GENERATOR section)
API_GENERATOR = {
# 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 Database
$ python manage.py makemigrations
$ python manage.py migrate
Step #5 -
Generate API
$ python manage.py generate-api
The code is generated under the api
folder in the root of the project.
Step #6 -
Use API
If the managed model is Books, the API interface is /api/books/
and all CRUD methods are available.
Django API Generator - Open-source library provided by AppSeed
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
Close
Hashes for django-api-generator-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c2978b83bdef0d1c288b236b7ac869570f5b69d4e9e2d1d0ec0324e2f1377c8 |
|
MD5 | 9ed8aa89821c52a068831c6fabecc951 |
|
BLAKE2b-256 | 61e543ecf8cf01305d213fc2094904db96fad87dfaf30c5862d1f4e9cd748d51 |