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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd7a629811f44cead6f918000dc363d9868187b035058697addf211956289962 |
|
MD5 | b1c6dc644464a028ba13dd1ec550c88e |
|
BLAKE2b-256 | aedc0f18b676f224403ea7cdb0ec78a5dde219b1f24db15fa20c43e68e73c4b2 |