Saravanan666/pypi-org huggingface dataset:
Package: django-rest-auth-e2e
===========
DeprecatedPlease usehttps://github.com/iMerica/dj-rest-authas this project is no longer maintained. Thanks!Welcome to django-rest-auth.. image::https://travis-ci.org/Tivix/django-rest-auth.svg:target:https://travis-ci.org/Tivix/django-rest-auth.. image::https://coveralls.io/repos/Tivix/django-rest-auth/badge.svg:target:https://coveralls.io/r/Tivix/django-rest-auth?branch=master.. image::https://readthedocs.org/projects/django-rest-auth/badge/?version=latest:target:https://readthedocs.org/projects/django-rest-auth/?badge=latestDjango-rest-auth provides a set of REST API endpoints for Authentication and RegistrationDocumentationhttp://django-rest-auth.readthedocs.org/en/latest/Source codehttps://github.com/Tivix/django-rest-authStack Overflowhttp://stackoverflow.com/questions/tagged/django-rest-auth
Package: django-rest-auth-forked
Welcome to django-rest-authWARNING: This is fork of the Tivix's repo for Django 4.0 compatibility. When that repo will ready. I'll remove this fork from PyPIRepository is unmaintained at the moment (on pause). More info can be found on this issue page:https://github.com/Tivix/django-rest-auth/issues/568.. image::https://travis-ci.org/Tivix/django-rest-auth.svg:target:https://travis-ci.org/Tivix/django-rest-auth.. image::https://coveralls.io/repos/Tivix/django-rest-auth/badge.svg:target:https://coveralls.io/r/Tivix/django-rest-auth?branch=master.. image::https://readthedocs.org/projects/django-rest-auth/badge/?version=latest:target:https://readthedocs.org/projects/django-rest-auth/?badge=latestDjango-rest-auth provides a set of REST API endpoints for Authentication and RegistrationDocumentationhttp://django-rest-auth.readthedocs.org/en/latest/Source codehttps://github.com/Tivix/django-rest-authStack Overflowhttp://stackoverflow.com/questions/tagged/django-rest-auth
Package: django-rest-auth-knaperek
Welcome to django-rest-auth===========================.. image:: https://travis-ci.org/Tivix/django-rest-auth.png:target: https://travis-ci.org/Tivix/django-rest-auth.. image:: https://coveralls.io/repos/Tivix/django-rest-auth/badge.png:target: https://coveralls.io/r/Tivix/django-rest-auth?branch=master.. image:: https://readthedocs.org/projects/django-rest-auth/badge/?version=latest:target: https://readthedocs.org/projects/django-rest-auth/?badge=latestDjango-rest-auth provides a set of REST API endpoints for Authentication and RegistrationDocumentation-------------http://django-rest-auth.readthedocs.org/en/latest/Source code-----------https://github.com/Tivix/django-rest-authStack Overflow-----------http://stackoverflow.com/questions/tagged/django-rest-auth
Package: django-rest-avatar
A django app for handling user avatars using Django Rest FrameworkDocumentationThe full documentation is athttps://django-rest-avatar.readthedocs.io.QuickstartInstall django-rest-avatar:pip install django-rest-avatarAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'rest_avatar.apps.DjangoRestAvatarConfig',...)Add django-rest-avatar’s URL patterns:fromrest_avatarimporturlsasrest_avatar_urlsurlpatterns=[...url(r'^',include(rest_avatar_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lHistory0.1.0 (2021-02-22)First release on PyPI.
Package: django-rest-batteries
Django REST Framework BatteriesBuild clean APIs with DRF faster.OverviewHere's a quick overview of what the library has at the moment:Action-based serializers for ViewSetsTwo serializers per request/response cycle for ViewSets and GenericAPIViewsAction-based permissions for ViewSetsSingle format for all errorsRequirementsPython ≥ 3.8Django ≥ 3.2Django REST Framework ≥ 3.12Installation$pipinstalldjango-rest-batteriesUsageAction-based serializers for ViewSetsEach action can have a separate serializer:fromrest_batteries.mixinsimportRetrieveModelMixin,ListModelMixinfromrest_batteries.viewsetsimportGenericViewSet...classOrderViewSet(RetrieveModelMixin,ListModelMixin,GenericViewSet):response_action_serializer_classes={'retrieve':OrderSerializer,'list':OrderListSerializer,}Two serializers per request/response cycleWe found that more often than not we need a separate serializer for handling request payload and a separate serializer for generating response data.How to achieve it in ViewSet:fromrest_batteries.mixinsimportCreateModelMixin,ListModelMixinfromrest_batteries.viewsetsimportGenericViewSet...classOrderViewSet(CreateModelMixin,ListModelMixin,GenericViewSet):request_action_serializer_classes={'create':OrderCreateSerializer,}response_action_serializer_classes={'create':OrderResponseSerializer,'list':OrderResponseSerializer,'cancel':OrderResponseSerializer,}How to achieve it in GenericAPIView:fromrest_batteries.genericsimportCreateAPIView...classOrderCreateView(CreateAPIView):request_serializer_class=OrderCreateSerializerresponse_serializer_class=OrderResponseSerializerAction-based permissions for ViewSetsEach action can have a separate set of permissions:fromrest_batteries.mixinsimportCreateModelMixin,UpdateModelMixin,ListModelMixinfromrest_batteries.viewsetsimportGenericViewSetfromrest_framework.permissionsimportAllowAny,IsAuthenticated...classOrderViewSet(CreateModelMixin,UpdateModelMixin,ListModelMixin,GenericViewSet):action_permission_classes={'create':IsAuthenticated,'update':[IsAuthenticated,IsOrderOwner],'list':AllowAny,}Single format for all errorsWe believe that having a single format for all errors is good practice. This will make the process of displaying and handling errors much simpler for clients that use your APIs.Any error always will be a JSON object with a message, code (identifier of the error), and field if the error is specific to a particular field. How your response could look like:{"errors":[{"message":"Delete or cancel all reservations first.","code":"invalid"},{"message":"Ensure this field has no more than 21 characters.","code":"max_length","field":"address.work_phone"},{"message":"This email already exists","code":"unique","field":"login_email"}]}You will not have a single format out-of-the-box after installation. You need to add an exception handler to your DRF settings:REST_FRAMEWORK={...'EXCEPTION_HANDLER':'rest_batteries.exception_handlers.errors_formatter_exception_handler',}CreditsDjango-Styleguide by HackSoftware- inspiration
Package: django-rest-caller
django-rest-callerSimple django templatetag for calling an urlconf view endpoint.Limitationsit works only for GET methodsit doesn't handle request without a bodyit doen't play nice with login required views (it assumes that the caller handles everything it is required to access the endpoint)it assumes that the endpoint returns a jsonInstallationInstall with pip$python3-mpipinstalldjango-rest-callerAddcaller.apps.CallerConfigtoINSTALLED_APPSINSTALLED_APPS=[...'caller.apps.CallerConfig',...]UsagecallIn your template load the templatetag{%loadcaller_tags%}and use thecalltag as{%call'urlconf'arg1=42arg2='X'withparam1='1'param2='2'as'object_name'%}or{%call'urlconf'42'X'withparam1='1'param2='2'as'object_name'%}'urlconf' arg1=42 arg2='X'this is the usual {% url %} parameters (remember: use args parameter list or kwargs parameters, not both)param1='1' param2='2'these parameters will be converted to GET querystringas 'object_name'store the called object into object_name object. It can be a string or a variable name.so the called url is equivalent to{%url'urlconf'arg1=42arg2='X'%}?param1=1&param2=2Thecallwill inject the result json object into the template context, so you canuse as context object{%loadcaller_tags%}{%call'api:blog-list'as'posts'%}{%forpostinposts%}<div><h2>{{post.title}}</h2><p>{{post.body}}</p></div>{%endfor%}feeding to json tag{%loadcaller_tags%}{%call'api:blog-list'as'posts'%}{{posts|json_script:"posts-data"}}<script>functionget_json(node){varel=document.getElementById(node);returnJSON.parse(el.textContent||el.innerText);}varposts=get_json("posts-data");console.log(posts);</script>json_scriptThis tag will backport the django >= 2.1json_scriptfilter,
which safely outputs a Python object as JSON, wrapped in a<script>tag, ready for use with JavaScript.examplewithvalue={'hello':'world'}and{{value|json_script:"hello-data"}}will output<scriptid="hello-data"type="application/json">{"hello":"world"}</script>and can be retrieved withfunctionget_json(name){varel=document.getElementById(name);returnJSON.parse(el.textContent||el.innerText);}vardata=get_json("hello-data");console.log(data);Changesdevexport utils.call ininit, so can dofrom caller import call0.2.1fix VERSION import error0.2.0extract generic code from templatetag0.1.5proper url unquote arg parameterscan use templatefilters in templatetag parameters0.1.4show raised exception in called view instead of a generic one0.1.3always requireas 'varname'be able to use args or kwargs for urlconf as documentedupdate documentation0.1.1 - 0.1.2update documentation0.1.0initial release
Package: django-rest-camel
=====================================Django REST Framework CamelCase magic=====================================.. image:: https://badge.fury.io/py/django-rest-camel.png:target: http://badge.fury.io/py/django-rest-camel.. image:: https://img.shields.io/pypi/v/django-rest-camel.svg:target: https://img.shields.io/pypi/v/django-rest-camel.svgCamel case support for Django REST framework - right now only JSON is supported.This project is a "resurrection fork" of djangorestframework-camel-case_ by Vitaly Babiy.. _djangorestframework-camel-case https://github.com/vbabiy/djangorestframework-camel-case============Installation============At the command line::$ pip install django-rest-camelAdd the render and parser to your django settings file... code-block:: python# ...REST_FRAMEWORK = {'DEFAULT_RENDERER_CLASSES': ('rest_camel.render.CamelCaseJSONRenderer',# Any other renders),'DEFAULT_PARSER_CLASSES': ('rest_camel.parser.CamelCaseJSONParser',# Any other parsers),}# ...=============Running Tests=============To run the current test suite, execute the following from the root of he project::$ tox=======License=======* Free software: BSD licenseHistory-------0.3.0 (2017-05-26)++++++++++++++++++* Fork of the project to maintain development* Drop Py26, Py33 and Py34 support* Drop DRF<3.0 support0.1.0 (2013-12-20)++++++++++++++++++* First release on PyPI.
Package: django-rest-captcha
Django rest captchaLightweight version ofdjango-simple-captchafor work withdjango-rest-framework.FeaturesSpeed: usecacheinstead of databaseSafety: union methods for generate key and image. (You can't generate many images for one key)Easy: only one rest api (for generate, refresh image).UsageAddRestCaptchaSerializerto your protected request validator:from rest_captcha serializer import RestCaptchaSerializer
class HumanOnlyDataSerializer(RestCaptchaSerializer):
    passThis code add to your serializer two required fields (captcha_key, captcha_value)For provide this fields client(js code) should generate key:> curl -X POST http:localhost:8000/api/captcha/ | python -m json.tool
{
    'image_type': 'image/png',
    'image_decode': 'base64',
    'captcha_key': 'de67e7f3-72d9-42d8-9677-ea381610363d',
    'captcha_value': '... image encoded in base64'
}captcha_value- is base64 encoded PNG image, client should decode and show this image to human for validation and send letters from captcha to protected api.
If human have mistake - client should re generate your image.Note:See alsotrottlingfor protect public apiInstall> pip install django-rest-captchaAdd to your settings.pyAdd to installed apps:INSTALLED_APPS = (
    ...
    'rest_captcha',
)Set rest_captcha settings (if you want), see defaults:REST_CAPTCHA = {
    'CAPTCHA_CACHE': 'default',
    'CAPTCHA_TIMEOUT': 300,  # 5 minutes
    'CAPTCHA_LENGTH': 4,
    'CAPTCHA_FONT_SIZE': 22,
    'CAPTCHA_IMAGE_SIZE': (90, 40),
    'CAPTCHA_LETTER_ROTATION': (-35, 35),
    'CAPTCHA_FOREGROUND_COLOR': '#001100',
    'CAPTCHA_BACKGROUND_COLOR': '#ffffff',
    'CAPTCHA_FONT_PATH': FONT_PATH,
    'CAPTCHA_CACHE_KEY': 'rest_captcha_{key}.{version}',
    'FILTER_FUNCTION': 'rest_captcha.captcha.filter_default',
    'NOISE_FUNCTION': 'rest_captcha.captcha.noise_default'
}We recommend using redis or local memory as cache with set parameter, with bigger value of MAX_ENTRIES:CACHES={
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'rest-captcha',
        'MAX_ENTRIES': 10000,
    }
}Add hooks to your app router (urls.py):urlpatterns = [
    ...
    url(r'api/captcha/', include('rest_captcha.urls')),
]
Package: django-rest-client
django-rest-clientAn abstract and extensible framework in python for building client SDKs and CLI tools for a RESTful API.Suitable for APIs made withdjango-rest-frameworkand other such general frameworks.For rapid building of ease-of-use, type-hinted and self-documented API clients in python.InstallationRequires python version >=3.6.$pip3installdjango_rest_clientFor usage withclick,pip3 install django_rest_client[cli]For development/testing,pip3 install django_rest_client[dev]Documentationpydragonflyis a complete project built on top of django-rest-client and serves as a good frame of reference for developers.Code reference: Please seeexample_project.CLI example: Open a terminal and rundjango_rest_client_example -h.Changelog:CHANGELOG.mdProjects using django-rest-clientpydragonflyLicenseBSD ©certego
Package: django-rest-coreapi-schema
Django restframework schemaThis package is a schema for django restframework.How to useInstallation$pipinstalldjango-rest-coreapi-schema$pipinstall-egit+https://github.com/emilioag/django_rest_coreapi_schema.git#egg=django_rest_coreapi_schemaConfigurationdjango settingsAdd the next configuration in your settings.py file.REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS':'django_rest_coreapi_schema.schema.CoreAPIAutoSchema',}Restframework docs (urls)Add to your urls.py the restframework docsfromdjango.conf.urlsimporturlfromrest_framework.documentationimportinclude_docs_urlsurlpatterns=[url(r'^docs/',include_docs_urls(title='My API title',description='API description',public=False)),]Create your serializersfromrest_frameworkimportserializersclassUserSerializer(serializers.Serializer):email=serializers.CharField(required=False,help_text="User email")address=serializers.CharField(required=False,help_text="User address")classFilterSerializer(serializers.Serializer):order=serializers.ChoiceField(required=False,choices=[("asc","Asc"),("desc","desc")],help_text="Order")username=serializers.CharField(required=False,help_text="Username pattern")classPathSerializer(serializers.Serializer):username=serializers.CharField(required=True,help_text="Username")Create your paginationfromrest_framework.paginationimportPageNumberPaginationclassLargeResultsSetPagination(PageNumberPagination):page_size=1000page_size_query_param='page_size'max_page_size=10000Create your viewDocumenting path variablesYou have to use the class variable:querysetfromdjango_rest_coreapi_schema.viewsimportDocumentedBaseViewclassUserView(DocumentedBaseView):queryset=PathSerializerUrl argsYou have to use the class variables:filter_backendsandfilter_fieldsfilter_backendsis a list of serializers which contains all the
possible url args.filter_fieldsis a list of arg names that will be appear in the
coreapi documentation.fromdjango_rest_coreapi_schema.viewsimportDocumentedBaseViewclassUserListView(DocumentedBaseView):filter_backends=[FilterSerializer]filter_fields=('order','username')BodyHttp put, post, etc. body.fromdjango_rest_coreapi_schema.viewsimportDocumentedBaseViewclassUserView(DocumentedBaseView):body_serializer_class=UserSerializerPagination (for large results)fromdjango_rest_coreapi_schema.viewsimportDocumentedBaseViewclassUserListView(DocumentedBaseView):pagination_class=LargeResultsSetPaginationYou can see a whole example in examples/restAPI folder inside this
repository.
Package: django-rest-crypto
Crypto Middleware for DjangoRestFrameworkInstallationpython3-mpipinstalldjango_rest_cryptoUsage# settings.pyMIDDLEWARES+=['django_rest_crypto.middlewares.EncryptDataMiddleware',]ENCRYPT_KEY=b'1234567890ABCDE'# 16, 24 or 32 bytes, requiredENCRYPT_MODE='CBC'# defaultENCRYPT_IV=b'1234567890ABCDE'# optionalENCRYPT_NONCE=b'1234567890ABCDE'# optional
Package: django-rest-delegated-permissions
Delegate django rest framework object permissions to an object pointed by foreign key/m2mSample: set up permissions so that anyone having django/django guardian permissions on Invoice will have the same set of permissions on its address:classAddress(models.Model):...addressfieldsclassInvoice(models.Model):address=models.OneToOneField(Address,related_name='invoice')...invoicefieldsperms=RestPermissions()@perms.apply(permissions=DelegatedPermissions(perms,"invoice")classAddressViewSet(ModelViewSet):queryset=Address.objects.all()serializer=AddressSerializer...@perms.apply()# implicitely adds django model permissions and guardian permissionsclassInvoiceViewSet(ModelViewSet):queryset=Invoice.objects.all()serializer=InvoiceSerializer...See docs and API atgithub.
Package: django-rest-durin
Django-Rest-DurinPer API client token authentication Module forDjango REST Framework.The idea is to provide one library that does token auth for multiple Web/CLI/Mobile API clients (i.e. devices/user-agents) via one interface but allows different token configuration for each client.Durin authentication is token based, similar to theTokenAuthenticationbuilt in to DRF. However, it adds some extra sauce:Durin allowsmultiple tokens per user. But only one token each user per API client.Each user token is associated with an API Client.These API Clients are configurable via Django's Admin Interface.Includespermission enforcingto allow only specific clients to make authenticated requests to certainAPIViewsor vice-a-versa.ConfigureRate-Throttlingper User <-> Client pair.Durin provides an option for a logged in user toremove all tokensthat the server has - forcing them to re-authenticate for all API clients.Durintokens can be renewedto get a fresh expiry.Durin provides aCachedTokenAuthenticationbackend as well which uses memoization for faster look ups.Durin providesSession Managementfeatures. Refer toSession Management Viewsi.e.,REST view for an authenticated user to get list of sessions (in context of django-rest-durin, this meansAuthTokeninstances) and revoke a session. Useful for pages like "View active browser sessions".REST view for an authenticated user to get/create/delete token against a pre-defined client. Useful for pages like "Get API key" where a user can get an API key to be able to interact directly with your project's RESTful API using cURL or a custom client.More information can be found in theDocumentation. I'd also recommend going through theexample_project/included in this repository.Django Compatibility MatrixIf your project uses an older verison of Django or Django Rest Framework, you can choose an older version of this project.This ProjectPython VersionDjango VersionDjango Rest Framework0.1+3.5 - 3.102.2, 3.0, 3.1, 3.2, 4.03.7>=Make sure to use at leastDRF 3.10when usingDjango 3.0or newer.Changelog / ReleasesAll releases should be listed in thereleases tab on GitHub.SeeCHANGELOGfor a more detailed listing.LicenseThis project is published with theMIT License. Seehttps://choosealicense.com/licenses/mit/for more information about what this means.CreditsDurin is inpired by thedjango-rest-knoxanddjango-rest-multitokenauthlibraries and adopts some learnings and code from both.
Package: django-rested
RestedMake creating rest APIs in Django simple.Rested is a simple batteries included tool to make building rest API's using Django fast and easy.UsageQuick StartCommand LineThe command line interface has commands to start a dev server, run development shell, run tests, run Django management commands, create an empty example project, and run a Celery background task worker.ValidationTo validate a field you must start with a root validator:to,am,accepts, oroptional.  All root
validators check that a field is defined before proceeding with the exception ofoptionalwhich will
immediately accept if the field is undefined on the json object.ContributingLauching Dev StackUse docker compose to launch development stack.Running TestsTo run tests:pytestTo run a specific test suite:pytest -s -k test_restedTo run a specific test in a suite:pytest -s -k "test_validate and test_check"To run tests with auto reload:env PYTHONPATH="/rested/tests" ptwTo run tests with auto reload and specific test:env PYTHONPATH="/rested/tests" ptw --runner "pytest -s -k test_rested"To see print statements of passing tests use the-sflagNote: Errors like this might have a root exception with more detail and may mean you are missing migrations:psycopg2.errors.InvalidCursorName
Package: django-rest-email-auth
Important LinksProject Homepagehttps://github.com/cdriehuys/django-rest-email-authDocumentationhttps://django-rest-email-auth.readthedocs.ioOverviewThis package provides a simple way to enable authentication with email addresses for a REST API.Features:Verification of user email addressesAuthentication using any of a user’s verified email addressesRegistration of new usersPassword resets using verified emailsCompatibilityPython:3.6 or laterDjango:Versions 3.2 through 4.1Django REST Framework:3.14 or laterAdding FeaturesThis package was primarily developed for a single project’s use. As such it may lack features that other projects require. If that is the case, pleaseopen an issueand let us know.LicenseThis project is licensed under the MIT License.AuthorsChathan Driehuys (chathan@driehuys.com)
Package: django-rest-email-manager
A Django app to manage user emails.DocumentationThe full documentation is athttps://django-rest-email-manager.readthedocs.io.QuickstartInstall django-rest-email-manager:pip install django-rest-email-managerAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'rest_email_manager',...)Add django-rest-email-manager’s URL patterns:urlpatterns=[...path('email-manager/',include('rest_email_manager.urls')),...]Create django-rest-email-manager’s database tables:pythonmanage.pymigrateFeaturesREST endpoints for allowing users to change their email address.Updated email addresses will require verification before they are set on the user.
Package: django-rest-enumfield
Django REST EnumFieldEnumField that uses python enums for Django REST FrameworkInstallationpip install django-rest-enumfieldUsageUse it as if its aChoiceField:importenumfromrest_enumfieldimportEnumFieldclassColor(enum.Enum):RED="red"GREEN="green"BLUE="blue"classSomeSerializer(Serializer):color=EnumField(choices=Color)Additionally you can override choice name and value generation by providingto_choiceorto_reprarguments:classSomeSerializer(Serializer):color=EnumField(choices=Color,to_choice=lambdax:(x.value,x.name),to_repr=lambdax:x.value)This will cause the enum’s value instead of the name to be represented.Thats it.
Package: django-rest-envelope
Django REST EnvelopTurn the ViewSet list endpoints to return an object rather than a list directly.InstallationFrom PYPi usingpip:pip install django-rest-envelopeUsageIn your viewset views, you can use theListEnvelopeMixinalong with another mixin that defines thelist()method:classMyViewSet(ListEnvelopeMixin,ReadOnlyModelViewSet):envelope:"my_envelope"In your ViewSet class that uses the mixin you have to define theenvelopeattribute.Additionally, you can overwrite theget_envelope()method to tweak the behaviour of
which envelope use in different situations.LicenceThis package is distributed underMIT Licence.