Saravanan666/pypi-org huggingface dataset:
Package: drf-pydantic-openapi
Generate OpenAPI schema with DRF code using pydantic models. Supports referencing other service's components.UsageAdd urls to the projecturlpatters=[path("openapi/",include("drf_pydantic_openapi.urls")),]Available endpoints/schema.json/docsReference another openapi sourceAdd the following setting to your projectssettings.py. This will allow the module to access to the other openapi components defined in seperate projects.# settings.pyDRF_PYDANTIC_OPENAPI={"REF_SOURCES":{"service_B":"http://localhost:8000/openapi","service_C":"http://localhost:8001/openapi",}}Using a component defined in another service# views.pyfromdrf_pydantic_openapi.ref_utilsimportRefTypeBookModel=RefType("service_B","BookModel")classBookView(ApiView):defget(self,request)->BookModel:...# More complex exampleclassCustomBookModel(RefType("service_B","BookModel")):# add new fieldread_count:intclassConfig:# Remove field from referenced typeref_exclude=("author",)# Rename fieldref_rename=(("book_name","name"),)classPaginatedBookModel(BaseModel):total:intnext:strprev:strdata:list[CustomBookModel]classBookView(ApiView):defget(self,request)->PaginatedBookModel:...Using the@docsParametersbody: Request body modelerrors: List of error modelsquery: Query modelpath: Api path parameter modelfrompydanticimportBaseModelfromdrf_pydantic_openapi.errorsimportBadRequestError,NotFoundErrorclassRetrieveQuery(BaseModel):book_id:strclassPath(BaseModel):book_id:str=Field(description="Book id to retrieve")classBookView(ApiView):@docs(errors=[NotFoundError],query=RetrieveQuery,path=Path)defget(self,request):......Typed exception handlerAssign thetyped_exception_handlerto rest framework. This will catch any ValidationError and the custom HttpError and return the response as json.# settings.pyREST_FRAMEWORK={"EXCEPTION_HANDLER":"drf_pydantic_openapi.exception_handler.typed_exception_handler"}# Examplefromdrf_pydantic_openapi.errorsimportBadRequestErrorclassSomeView(ApiView):@docs(errors=[BadRequestError])defpost(self,request):raiseBadRequestError()Response{"detail":{"message":"Bad request"}}
Package: drf_pyjwt
drf_pyjwtA JSON Web Token authentication extension for the Django REST FrameworkInstallationUsing pippip install drf_pyjwtUsing pipenvpipenv install drf_pyjwtQuick startIn your project’ssettings.pyadd these settings.DRF_PYJWT_JWKS_URI = "https://api.sample/jwks.json"
DRF_PYJWT_ALGORITHMS = ["RS256"]
DRF_PYJWT_KWARGS = {"audience": "https://api.sample"}Inviews.pyaddPyJWTAuthenticationclass to authentication classes.@api_view(["get"])
@authentication_classes([PyJWTAuthentication])
def example(request: Request) -> Response:
    token: dict = request.auth
    print("Access token: {token}")
    return Response({"some": "response"})By defaultPyJWTAuthenticationcannot lookup user by token, that's why you will getNoneinrequest.user.
You can provide lookup user function usingDRF_PYJWT_LOOKUP_USERsetting.
After thisPyJWTAuthenticationwill populaterequest.userusing provided function.Settings ReferenceDRF_PYJWT_JWKS_URIRequired:TrueType:strValue which will be passed asuriargument tojwt.jwks_client.PyJWKClientfunctionDRF_PYJWT_ALGORITHMSRequired:FalseType:List[str]Default:["RS256"]Example:DRF_PYJWT_ALGORITHMS = "https://dev-87evx9ru.auth0.com/.well-known/jwks.json"Value which will be passed asalgorithmsargument tojwt.decodefunction.DRF_PYJWT_OPTIONSRequired:FalseType:dictExample:DRF_PYJWT_OPTIONS = {"verify_exp": False}Value which will be passed asoptionsargument tojwt.decodefunction.DRF_PYJWT_KWARGSRequired:FalseType:dictExample:DRF_PYJWT_KWARGS = {"audience": "https://app.domain"}Value which will be passed as**kwargsargument tojwt.decodefunction.DRF_PYJWT_LOOKUP_USERRequired:FalseType:str(Import path to theCallable[[dict], Optional[AbstractBaseUser]])Example:def lookup_user(token: dict) -> Optional[AbstractBaseUser]:
    user_id = token["custom_claim_user_id"]
    user = User.objects.filter(pk=user_id).first()
    return user
Package: drf-queryset
IntroductionThe DRF Queryset Mixin is a utility for optimizing database queries in Django REST Framework (DRF) viewsets. It provides a mixin calledQuerysetMixinthat allows you to easily optimize your queries by specifying deferred, selected related, and prefetched related fields.Installationpip install drf-querysetUsagePlease follow the steps:Import theQuerysetMixinfromdrf_queryset.mixins.In your viewset class, inherit fromQuerysetMixin.only_fields: List of fields to be only fetched in the query.defer_fields: List of fields to be deferred in the query.select_related_fields: List of fields to be select_related in the query.prefetch_related_fields: List of fields to be prefetch_related in the query.Note: These fields are optional, you can use them depending upon your requirements of queryset and structure of the model fields.ExampleHere's a basic example of how you can use this package in your django rest framework application:from drf_queryset.mixins import QuerysetMixin
from rest_framework.viewsets import ModelViewSet
from .models import YourModel
from .serializers import YourSerializer

class MyViewSet(QuerysetMixin, ModelViewSet):
    queryset = YourModel.objects.all()  # Replace with your queryset
    serializer_class = YourSerializer  # Replace with your serializer

    defer_fields = ['field1', 'field2']  # Add your defer fields here
    only_fields = ['field3', 'field4']  # Add your only fields here
    select_related_fields = ['related_field1', 'related_field2']  # Add your select_related fields here
    prefetch_related_fields = ['m2m_field', 'reverse_fk_field']  # Add your prefetch_related fields hereLicenseMIT License
Package: drf-queryset-optimization
drf-queryset-optimizationA Django package that provides mixins for optimizing querysets in Django REST Framework views and viewsets.FeaturesDefer specific fields in queryset using class attributes.Include only specific fields in queryset using class attributes.Installationpip install drf-queryset-optimizationUsageUsing the optimization mixins in your viewsets is straightforward:Import theQuerysetOptimizationMixinfromdrf_queryset_optimization.mixins.In your viewset class, inherit fromQuerysetOptimizationMixin.Specify the fields you want to defer or include using thedefer_fieldsandonly_fieldsclass attributes.ExampleHere's a basic example of how you can use the package in your project:from drf_queryset_optimization.mixins import QuerysetOptimizationMixin
from rest_framework.viewsets import ModelViewSet
from .models import YourModel
from .serializers import YourSerializer

class OptimizedModelViewSet(QuerysetOptimizationMixin, ModelViewSet):
    defer_fields = ["field1", "field2"]  # Fields to defer
    only_fields = []  # Fields to include

    queryset = YourModel.objects.all()
    serializer_class = YourSerializerLicenseMIT License
Package: drf-querystringfilter
Filter backend for DjangoRestFramework able to parse url parametersSupports drf 3.5.x, 3.6.x, 3.7.x, 3.8.x Django 1.10.x, 1.11.x, 2.0.x, python 2.7, 3.6DocumentationThe full documentation is athttps://drf-querystringfilter.readthedocs.org.Basic UsageclassUserSerializer(ModelSerializer):classMeta:model=Userexclude=()classUsers(ListAPIView):serializer_class=UserSerializerfilter_fields=['username','email','is_staff','date_joined']filter_blacklist=Nonefilter_backends=(QueryStringFilterBackend,)queryset=User.objects.all()now you can query using…-/users/?username=sax-/users/?username__startswith=sa&date_joined__year=2000-/users/?email__contains=@gmail.com-/users/?is_staff=trueLinksStableDevelopmentProject home page:https://github.com/saxix/drf-querystringfilterIssue tracker:https://github.com/saxix/drf-querystringfilter/issues?sortDownload:http://pypi.python.org/pypi/drf-querystringfilter/Documentation:https://drf-querystringfilter.readthedocs.org/en/latest/1.0First stable release0.7.0abstract query_params habdlinghandle multple values in query stringBACKWARD INCOMPATIBLE:__innow accept raw values and can appear multiple timesnew operators__inlistand__not_inlistto be used for backward compatibility with__inand__not_in0.6.0Add handling of format query param0.5.0 18/06/2018add support for django 2.0addquery_paramsproperty to allow handling POST request0.4.0 29/05/2017add ‘__inarray’ and  ‘__int_inarray’ lookup to handle json/arrays lookup both str/int0.3.0 10/10/16add ‘_distinct’ parameter to enable ‘.distinct()’ queries0.2.0 19/09/16add ‘ignore_filter’ to ignore querystring arguments0.1.0 11/09/16First release on PyPI.
Package: drfr
Dimension Reduction Function Research (drfr)This package provides a Reduction Model and Regression Model, which respectively
contains several choices for reduction and regression of data. It also contains several novelty detection methods for preprocessingDiscription of Each ModelReduction Modelcontains "NPPE", "UMAP", "LLE", "Hessian", "Spectral", "TSNE", "Isomap", used
as keyword argumenttagin functionget_reduction().
To make tag "UMAP" work properly, an install according tohttps://github.com/lmcinnes/umapis needed.Regression Modelcontains "lasso", "ridge", "MARS",  used
as keyword argumenttagin functioncal_regression(). As basis generator
either those in BasisGenerator or self made function can be used, where data X
should be the only positional argument.Basis Generatorcontains several functions as basis generators, with form# generate_basis_function(X, p=basis_degree)Novelty DetectorThe detector contains reimplemented kernel PCA, diffusion map, and robust PCA (used in Robust Hessian LLE). More methods can be found in the packagepyod by Y.Zhao et.al.
Use argumentmethodto choose a method, includingkpca, dmap, pca, lof, ocsvm, iforest, rforest, rbhessian.InstallizationpipinstalldrfrUsagefromdrfrimportReductionModel,BasisGenerator,RegressionModel,NoveltyDetectorfromsklearnimportdatasetsimportnumpyasnpimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3Dif__name__=="__main__":N=2000k=24X,color=datasets.samples_generator.make_swiss_roll(n_samples=N,noise=0.001)basis_generator=Noneoutlier_quote=0.8poly_degree=4tag_red="NPPE"tag_reg="MARS"# preprocessingscores=NoveltyDetector.evaluate_novelty(X,labels=color,method="pca")inlier_ind=np.argwhere(scores<outlier_quote*scores.max()).flatten()X=X[inlier_ind]color=color[inlier_ind]# compute embedded resultred_model=ReductionModel.ReductionModel()y_nppe=red_model.get_reduction(X,tag=tag_red)# compute regression weights w given X and y, and compute basis(X)*yreg_model=RegressionModel.RegressionModel()y_reg=reg_model.cal_regression(X,y_nppe,tag=tag_reg,basis_generator=BasisGenerator.generate_fourier,p=poly_degree)# draw resultsfig=plt.figure()ax=fig.add_subplot(311,projection='3d')ax.scatter(X[:,1],X[:,0],X[:,2],c=color,cmap=plt.cm.Spectral)ax.set_title("Original data")ax=fig.add_subplot(312)ax.scatter(y_nppe[:,1],y_nppe[:,0],c=color,cmap=plt.cm.Spectral)plt.axis('tight')plt.xticks([]),plt.yticks([])plt.title('Projected data with method'+tag_red)ax=fig.add_subplot(313)ax.scatter(y_reg[:,1],y_reg[:,0],c=color,cmap=plt.cm.Spectral)plt.axis('tight')plt.xticks([]),plt.yticks([])plt.title("NPPE embedded data regressed by "+tag_reg+" Model\n"+"with basis degree"+poly_degree.__str__())plt.show()
Package: drf-rbac-plus
Django-Rest-Framework RBAC plusBased on the django USER model, a permission system based on RBAC mode is implemented,
which provides a background admin entry mechanism for permission,
and implements permission control with drf middleware.RequirementsPython (3.5, 3.6, 3.7, 3.8)Django (2.1, 2.2, 3.0)Ihighly recommendand only officially support the latest patch release of each Python and Django series.InstallationInstall using pip...pip install drf-rbac-plusAdd 'drf_rbac' to your INSTALLED_APPS setting.INSTALLED_APPS = [
    ...
    'drf_rbac',
]Add path to your URL setting.urlpatterns = [
    ...
    path('drf_rbac/', include('drf_rbac.urls')),
]Add UserRolePermission to your DEFAULT_PERMISSION_CLASSES(django-restframework setting).'DEFAULT_PERMISSION_CLASSES': (
        ...
        'drf_rbac.authorization.UserRolePermission',
    ),ExampleRegexValidatorThese validators can be used to customized regex, the value must be match the 'word'(r"^[a-zA-Z\u4e00-\u9fa5]+$")aa
Package: drf-recaptcha-e2e
Django REST reCAPTCHADjango REST reCAPTCHA v2 and v3 field serializerRequirementsPython: 3.7, 3.8, 3.9, 3.10, 3.11Django: 3.2, 4.0, 4.1, 4.2DRF: 3.11, 3.12, 3.13, 3.14InstallationSign up for reCAPTCHAInstall withpip install drf-recaptchaAdd"drf_recaptcha"to yourINSTALLED_APPSsettings.Set in settingsDRF_RECAPTCHA_SECRET_KEYINSTALLED_APPS=[...,"drf_recaptcha",...,]...DRF_RECAPTCHA_SECRET_KEY="YOUR SECRET KEY"Usagefromrest_framework.serializersimportSerializer,ModelSerializerfromdrf_recaptcha.fieldsimportReCaptchaV2Field,ReCaptchaV3Fieldfromfeedback.modelsimportFeedbackclassV2Serializer(Serializer):recaptcha=ReCaptchaV2Field()...classGetOTPView(APIView):defpost(self,request):serializer=V2Serializer(data=request.data,context={"request":request})serializer.is_valid(raise_exception=True)...classV3Serializer(Serializer):recaptcha=ReCaptchaV3Field(action="example")...classV3WithScoreSerializer(Serializer):recaptcha=ReCaptchaV3Field(action="example",required_score=0.6,)...classGetReCaptchaScore(APIView):defpost(self,request):serializer=V3WithScoreSerializer(data=request.data,context={"request":request})serializer.is_valid()score=serializer.fields['recaptcha'].score...classFeedbackSerializer(ModelSerializer):recaptcha=ReCaptchaV2Field()classMeta:model=Feedbackfields=("phone","full_name","email","comment","recaptcha")defvalidate(self,attrs):attrs.pop("recaptcha")...returnattrsSettingsDRF_RECAPTCHA_SECRET_KEY- set your Google reCAPTCHA secret key. Type: str.DRF_RECAPTCHA_DEFAULT_V3_SCORE- by default:0.5. Type: float.DRF_RECAPTCHA_ACTION_V3_SCORES- by default:{}. Type: dict. You can define specific score for each action e.g.{"login": 0.6, "feedback": 0.3}DRF_RECAPTCHA_DOMAIN- by default:www.google.com. Type: str.DRF_RECAPTCHA_PROXY- by default:{}. Type: dict. e.g.{'http': 'http://127.0.0.1:8000', 'https': 'https://127.0.0.1:8000'}DRF_RECAPTCHA_VERIFY_REQUEST_TIMEOUT- by default:10. Type: int.reCAPTCHA v3Validation is passed if the score value returned by Google is greater than or equal to required score.Required score value:0.0 - 1.0Priority of score valueIf not defined or zero in current item then value from next item.Value for action in settingsDRF_RECAPTCHA_ACTION_V3_SCORESValue in argumentrequired_scoreof fieldDefault value in settingsDRF_RECAPTCHA_DEFAULT_V3_SCOREDefault value0.5TestingSetDRF_RECAPTCHA_TESTING=Truein settings, no request to Google, no warnings,DRF_RECAPTCHA_SECRET_KEYis not required, set returning verification result in setting below.DRF_RECAPTCHA_TESTING_PASS=True|False- all responses are pass, defaultTrue.Usefrom django.test import override_settingsCreditsdjango-recaptchareCAPTCHA copyright 2012 Google.
Package: drf-recaptcha-new
Django REST reCAPTCHADjango REST reCAPTCHA v2 and v3 field serializerRequirementsPython: 3.7, 3.8, 3.9, 3.10Django: 3.2, 4.0, 4.1DRF: 3.11, 3.12, 3.13, 3.14InstallationSign up for reCAPTCHAInstall withpip install drf-recaptchaAdd"drf_recaptcha"to yourINSTALLED_APPSsettings.Set in settingsDRF_RECAPTCHA_SECRET_KEYINSTALLED_APPS=[...,"drf_recaptcha",...,]...DRF_RECAPTCHA_SECRET_KEY="YOUR SECRET KEY"Usagefromrest_framework.serializersimportSerializer,ModelSerializerfromdrf_recaptcha.fieldsimportReCaptchaV2Field,ReCaptchaV3Fieldfromfeedback.modelsimportFeedbackclassV2Serializer(Serializer):recaptcha=ReCaptchaV2Field()...classGetOTPView(APIView):defpost(self,request):serializer=V2Serializer(data=request.data,context={"request":request})serializer.is_valid(raise_exception=True)...classV3Serializer(Serializer):recaptcha=ReCaptchaV3Field(action="example")...classV3WithScoreSerializer(Serializer):recaptcha=ReCaptchaV3Field(action="example",required_score=0.6,)...classGetReCaptchaScore(APIView):defpost(self,request):serializer=V3WithScoreSerializer(data=request.data,context={"request":request})serializer.is_valid()score=serializer.fields['recaptcha'].score...classFeedbackSerializer(ModelSerializer):recaptcha=ReCaptchaV2Field()classMeta:model=Feedbackfields=("phone","full_name","email","comment","recaptcha")defvalidate(self,attrs):attrs.pop("recaptcha")...returnattrsSettingsDRF_RECAPTCHA_SECRET_KEY- set your Google reCAPTCHA secret key. Type: str.DRF_RECAPTCHA_DEFAULT_V3_SCORE- by default:0.5. Type: float.DRF_RECAPTCHA_ACTION_V3_SCORES- by default:{}. Type: dict. You can define specific score for each action e.g.{"login": 0.6, "feedback": 0.3}DRF_RECAPTCHA_DOMAIN- by default:www.google.com. Type: str.DRF_RECAPTCHA_PROXY- by default:{}. Type: dict. e.g.{'http': 'http://127.0.0.1:8000', 'https': 'https://127.0.0.1:8000'}DRF_RECAPTCHA_VERIFY_REQUEST_TIMEOUT- by default:10. Type: int.reCAPTCHA v3Validation is passed if the score value returned by Google is greater than or equal to required score.Required score value:0.0 - 1.0Priority of score valueIf not defined or zero in current item then value from next item.Value for action in settingsDRF_RECAPTCHA_ACTION_V3_SCORESValue in argumentrequired_scoreof fieldDefault value in settingsDRF_RECAPTCHA_DEFAULT_V3_SCOREDefault value0.5TestingSetDRF_RECAPTCHA_TESTING=Truein settings, no request to Google, no warnings,DRF_RECAPTCHA_SECRET_KEYis not required, set returning verification result in setting below.DRF_RECAPTCHA_TESTING_PASS=True|False- all responses are pass, defaultTrue.Usefrom django.test import override_settingsCreditsdjango-recaptchareCAPTCHA copyright 2012 Google.
Package: drf-redesign
🚀 drf-redesigndrf-redesignis a project that gives a fresh look to the browse-able API of Django REST Framework using Bootstrap 5.We want to make the API moreappealingandintuitivefor developers and users alike.
That's why we created astylishandmoderndesign that makes the API easier to navigate and interact with.
One of the coolest features of drf-redesign is thedark modeoption.
You can switch to a dark theme that is not onlyeye-friendlybut alsosuper cool.Our goal with drf-redesign is to make your life easier when working with Django REST Framework.
We think that by enhancing the user experience, we can help you save time and be more efficient.So if you're looking for a better way to work with Django REST Framework, don't miss drf-redesign.
We're sure you'll enjoy it as much as we do!🌟 FeaturesModern design: drf-redesign uses Bootstrap 5, the latest version of the most popular front-end framework,
to create a sleek and responsive design for the API.Accessibility: drf-redesign follows the best practices for web accessibility,
ensuring that the API is easy to use for everyone, regardless of their abilities or preferences.Light and dark themes: drf-redesign lets you choose between a light or a dark color scheme for the API,
depending on your mood or environment. You can switch between the themes with a simple click of a button.Bootstrap icons: drf-redesign uses Bootstrap icons, a set of open source icons designed for Bootstrap components,
to add some visual flair to the API. The icons are scalable, customizable, and easy to use.Form input max length indicators: drf-redesign shows the maximum length of each form input field,
so you know how much data you can enter. The indicators also change color when you reach the limit, giving you visual feedback.Form inputs required indicators: drf-redesign marks the required form input fields with an asterisk (*),
so you know which fields are mandatory to submit the form. The indicators also show an error message if you try to submit the form without filling the required fields.Browser form validation: drf-redesign uses the built-in browser form validation features, such as HTML5 attributes,
to validate the form input data before sending it to the server. The validation checks for formats, patterns, ranges, and more.ImagesDRF Redesign Dark ModeDRF Redesign Light Mode🛠️ Get startedTo use drf-redesign, follow these simple steps:Install the package:pip install drf-redesignAdddrf_redesigntoINSTALLED_APPSsetting, beforerest_framework# settings.pyINSTALLED_APPS=[...'drf_redesign','rest_framework',...]That's it! You're ready to go. 😎I hope you find this useful. Let me know if you have any feedback or questions. 😊
Package: drf-registration
DRF RegistrationSimple user registration package based on Django Rest Framework. DRF Registration - The easy way to generate registration RESTful APIs.Check the document athttps://drf-registration.readthedocs.io/RequirementsDjango (>=2.0)Django REST Framework (>=3.8.2)Python (>=3.6)FeaturesRegisterVerify/activate account by token sent to emailLogin use tokenLogoutUser profileChange passwordReset passwordLogin by socials (Facebook, Google)Set password when login by socialSync user account with socialsHTML email configurationTest coverage (98%)Installation & ConfigurationInstall by usepip:pip install drf-registrationAdddrf_registrationinINSTALLED_APPSINSTALLED_APPS = [
    ...
    'rest_framework',
    'rest_framework.authtoken',
    'drf_registration',
    ...
]Include urls ofdrf_registrationinurls.pyurlpatterns = [
    ...
    path('/api/accounts/', include('drf_registration.urls')),
    ...
]SettingsSetAUTHENTICATION_BACKENDfor support login by multiple custom fields and check inactivate user when login:AUTHENTICATION_BACKENDS = [
    'drf_registration.auth.MultiFieldsModelBackend',
]You can update login username fields by changeLOGIN_USERNAME_FIELDSinDRF_REGISTRATIONobject. Default to['username', 'email',].SetDEFAULT_AUTHENTICATION_CLASSESinREST_FRAMEWORKconfigurationREST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework.authentication.TokenAuthentication',
    ],
}Design settingsDRF_REGISTRATION = {

}Check default settingshere.Base APIs DesignAssuming that base resource is/api/v1/accounts/POST: /register/: Register new userPOST: /verify/: Verify account by emailPOST: /login/: Login to the system use username/email and passwordPOST: /logout/: Logout of the systemGET: /profile/: Get user profilePUT: /profile/: Update user profilePUT: /change-password/: Change user passwordPUT: /set-password/: Set user password when login with social accountCheck more APIs Design athere.Command lineUnit Testmake testYou can addARGS="specific_folder/"orARGS="specific_file.py"to run specific test cases.Run pylintmake pylintBuild & run docs local servermake docsAccess docs server athttp://localhost:8080Cleanmake clean
Package: drf-replace-ordering-filter
# drf-replace-ordering-filterDjango Rest Framework OrderingFilter backend to replace field name in ordering params.This package is useful if you have custom hidden fields in you model to help with a better ordering.## UsageYou can user ```ReplaceFieldOrderingFilter``` as a Default Filter Backend in Rest Framework setting or specifying in a certain APIView.```ReplaceFieldOrderingFilter``` works in the same way as ```rest_framework.filters.OrderingFilter```, if you do not define fields in a View to be replaced.### 1. As a default settingFirst of all, add ```ReplaceFieldOrderingFilter``` to DEFAULT_FILTER_BACKENDS in ```setting.py``` file of your Django's project.``` pythonREST_FRAMEWORK = {'DEFAULT_FILTER_BACKENDS': ('drf_replace_ordering_filter.filters.ReplaceFieldOrderingFilter',)}```Lastly, in a view that you want to change some ordering filed to another, add the following attribute.```pythonfrom rest_framework import viewsclass MyAPIView(views.APIView):replace_ordering_fields = {'field_to_be_replaced': 'new_field'}def get(self, request, *args, **kwargs):pass```### 2. In a specific viewThe second option is using ```ReplaceFieldOrderingFilter``` only in a specfic view or viewset.For example:```pythonfrom drf_replace_ordering_filter.filters import ReplaceFieldOrderingFilterfrom rest_framework import viewsclass MyAPIView(views.APIView):filter_backends = (ReplaceFieldOrderingFilter,)replace_ordering_fields = {'field_to_be_replaced': 'new_field'}def get(self, request, *args, **kwargs):pass```