api.v2 package¶
The second version of the API.
Submodules¶
api.v2.apps module¶
App configuration.
-
class
api.v2.apps.
ApiV2Config
(app_name, app_module)[source]¶ Bases:
django.apps.AppConfig
Configuration for the api.v2 app.
api.v2.auth module¶
Authentication & authorization utilities.
-
class
api.v2.auth.
ApiKeyAuthentication
[source]¶ Bases:
rest_framework.authentication.TokenAuthentication
API key authentication class.
-
keyword
= 'X-API-Key'¶
-
model
¶ alias of
users.models.ApiKey
-
api.v2.mixins module¶
API mixin classes.
api.v2.pagination module¶
Pagination utilities.
-
class
api.v2.pagination.
DummyPagination
[source]¶ Bases:
rest_framework.pagination.BasePagination
Dummy pagination class that simply wraps results.
api.v2.schema module¶
Schema utilities.
-
class
api.v2.schema.
OpenAPISchema
(tags=None, operation_id_base=None, component_name=None)[source]¶ Bases:
rest_framework.schemas.openapi.AutoSchema
Custom OpenAPI schema class.
-
header_regex
= re.compile('^\\* [a-z]+:')¶
-
variable_regex
= re.compile('{([^}]+)}')¶
-
api.v2.urls module¶
The URLconf of the api.v2 app.
-
api.v2.urls.
app_name
= 'v2'¶ The URL namespace of the api.v2 app.
-
api.v2.urls.
urlpatterns
= [<URLResolver <URLPattern list> (None:None) ''>, <URLPattern 'profile'>, <URLPattern 'openapi.json' [name='schema']>, <URLPattern 'redoc/' [name='redoc']>, <URLPattern 'swagger/' [name='swagger']>]¶ The URL patterns of the api.v2 app.
api.v2.views module¶
The custom views of the api.v2 app.
-
api.v2.views.
openapi
(self, request, *args, **kwargs)¶ The generated OpenAPI schema as a view.
-
api.v2.views.
redoc_redirect
(request)[source]¶ Redirect to the ReDoc demo with our schema.
- Parameters
request (
HttpRequest
) –- Return type
-
api.v2.views.
swagger_redirect
(request)[source]¶ Redirect to the Swagger generator with our schema.
- Parameters
request (
HttpRequest
) –- Return type