
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
django-declarative-apis
Advanced tools
django-declarative-apis is a framework built on top of Django aimed at teams implementing RESTful APis. It provides a simple interface to define endpoints declaratively. Some benefits to using django-declarative-apis:
This guide is intended to demonstrate the bare minimum in order to get a django-declarative-apis project up and running. The example directory contains further examples using endpoint to model relationships, authentication and response attribute filtering.
./manage startapp myapp
INSTALLED_APPS = [
'django_declarative_apis',
'myapp',
]
DECLARATIVE_ENDPOINT_RESOURCE_ADAPTER = 'django_declarative_apis.adapters.EndpointResource'
DECLARATIVE_ENDPOINT_AUTHENTICATION_HANDLERS = 'django_declarative_apis.authentication.oauthlib.oauth1.TwoLeggedOauth1'
from django_declarative_apis import adapters
import myapp.resources
class NoAuth:
@staticmethod
def is_authenticated(request):
return True
urlpatterns = [
url(
r'^ping$',
adapters.resource_adapter(
get=myapp.resources.PingDefinition,
authentication=NoAuth
)
),
]
from django.conf.urls import url, include
import myapp.urls
urlpatterns = [
url(r'^', include(myapp.urls)),
]
from django_declarative_apis import machinery
class PingDefinition(machinery.BaseEndpointDefinition):
def is_authorized(self):
return True
@property
def resource(self):
return {'ping': 'pong'}
# settings.py
DDA_EVENT_HOOK = "my_app.hooks.custom_event_handler"
FAQs
Simple, readable, declarative APIs for Django
We found that django-declarative-apis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.