Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
drf-schema-adapter
is a set of tools used to make it as straight-forward to declare an API endpoint
as it is to declare a new ModelAdmin
in Django and export the corresponding definition to frontend
frameworks and libraries.
DRF-schema-adapter is compatible with the following matrix
Py 3.8 | Py 3.9 | Py 3.10 | Py 3.11 | |
---|---|---|---|---|
Django 3.2 | DRF 3.12+ | DRF 3.12+ | N/A | N/A |
Django 4.0 | DRF 3.12+ | DRF 3.12+ | DRF 3.12+ | N/A |
Django 4.1 | DRF 3.12+ | DRF 3.12+ | DRF 3.12+ | DRF 3.12+ |
:warning: For Python 2.7 or Django 1.x support, please use versions 1.x or prior :warning: For Django Version 3.1 or prior, use version 2.x
:warning: For Python 3.11 compatibility, you will have (for now) to install Inflector directly from the repo:
pip install git+https://github.com/ixmatus/inflector@ef5c19dc2aa8df5e6b4c452ff2d9b54ec41a04a8#egg=Inflector
pip install drf-schema-adapter
If you are using python 3.11, you will have to also install Inflector directly from the repo, pending the release of Inflector 3.0.2
pip install git+https://github.com/ixmatus/inflector@ef5c19dc2aa8df5e6b4c452ff2d9b54ec41a04a8#egg=Inflector
Within the source directory:
python setup.py install
You can see a demo application running at https://djembersample.pythonanywhere.com/.
First of all you'll need to import the default EndpointRouter in your urls.py file.
from drf_auto_endpoint.router import router
As well as add its urls to your urlpatterns
in urls.py
, the same way you would with DRF's
DefaultRouter
.
urlpatterns = [
...
path("api/", include(router.urls)),
...
]
The quickest way to get a working endpoint is to register a model with the router. Register accepts
an optional keyword argument for the url
associated to that endpoint. By default the url for an
endpoint willbe app_label/verbose_name_plural
from django.urls import include, path
from drf_auto_endpoint.router import router
from my_app.models import MyModel, OtherModel
router.register(MyModel)
router.register(OtherModel, url='my_custom_url')
urlpatterns = [
path("api/", include(router.urls)),
]
OPTIONS
callsDjango REST framework provides the ability to customize those calls thanks to metadata classes.
Setup DRF to use one of DRF-schema-adapter's metadata classes to get schema information:
## settings.py
...
REST_FRAMEWORK = {
'DEFAULT_METADATA_CLASS': 'drf_auto_endpoint.metadata.AutoMetadata',
}
First add 'export_app'
to your setting's INSTALLED_APPS
, then run:
./manage.py export --adapter_name EmberAdapter samples/products
For much more complete documentation, please see: http://drf-schema-adapter.readthedocs.io
If you'd like to contibute to DRF-schema-adapter*, you are more than welcome to do so. In order to make contributing to this project a rich experience for everyone, please follow these guide-lines:
License information available here.
Contributors code of conduct is available here. Note that this COC will be enforced.
FAQs
Making using Django with frontend libraries and frameworks DRYer
We found that drf-schema-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.