Saravanan666/pypi-org huggingface dataset:
Package: django-rest-framework-stripe
======================django-stripe-payments======================a payments Django app for Stripe.. image:: https://img.shields.io/travis/pinax/django-stripe-payments.svg:target: https://travis-ci.org/pinax/django-stripe-payments.. image:: https://img.shields.io/coveralls/pinax/django-stripe-payments.svg:target: https://coveralls.io/r/pinax/django-stripe-payments.. image:: https://img.shields.io/pypi/dm/django-stripe-payments.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/.. image:: https://img.shields.io/pypi/v/django-stripe-payments.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/.. image:: https://img.shields.io/badge/license-MIT-blue.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/This app allows you to process one off charges as well as signup users forrecurring subscriptions managed by Stripe.Documentation can be found at http://django-stripe-payments.readthedocs.orgSome suggested integration steps:1. Overload the templates provided to use your inheritance tree (for bases etc) and block names.2. Point your stripe account at the webhook address in the payments urls.3. Add the static media snippet from here (or else nothing will actually talk to stripe):* http://django-stripe-payments.readthedocs.org/en/latest/installation.html#configuration-modifications-to-settings-py4. Set up SSL if you have not already.5. Define some plans (see docs).6. Run syncdb to generate the necessary tables, then init_plans and init_customers.Development-----------To run test suite::$ pip install detox$ detox
Package: djangorestframework-stubs
pep484 stubs for Django REST frameworkMypy stubs forDjango REST Framework.
Supports Python 3.8 and up.Installationpipinstalldjangorestframework-stubs[compatible-mypy]To make mypy aware of the plugin, you need to add[mypy]plugins=mypy_drf_plugin.mainin yourmypy.inifile.FAQModel instance is inferred asAnyinstead of myModelclassWhen subclassingModelSerializer, add atype argumentto type-hint the related model class, for example:classMyModelSerializer(serializers.ModelSerializer[MyModel]):classMeta:model=MyModelfields=("id","example")Which means that methods where the model is being passed around will know the actual type of the model instead of beingAny. Theinstanceattribute on the above serializer will beUnion[MyModel, typing.Sequence[MyModel], None].To get helpWe have Gitter here:https://gitter.im/mypy-django/LobbyIf you think you have more generic typing issue, please refer tohttps://github.com/python/mypyand their Gitter.ContributingThis project is open source and community driven. As such we encourage contributions big and small. You can contribute by doing any of the following:Contribute code (e.g. improve stubs, add plugin capabilities, write tests etc) - to do so please follow thecontribution guide.Assist in code reviews and discussions in issues.Identify bugs and issues and report theseYou can always also reach out in gitter to discuss your contributions!
Package: django-rest-framework-supertest
django-rest-framework-supertestAnWORK IN PROGRESSset of utilities to write automated tests for APIS writen in django-rest-framework.MotivationThedjangoanddjango-rest-frameworkis an powerfull set of tools to createREST API's. But, testing theseAPI', with automated tests, are a little more complex question. Write a lot of repeated code and the difficult to made all assertions along theREST API'sresponses is some of these problems for our apps.This project wants to aggregate utilities to made assertions on the responses, likeAPIExceptionresponses, and utilities to work with other complexREST API'sconcepts, like pagination and authentication.Under the HoodUnder the hood, this is only an set of utilities and this uses some libraries to work correctly. Actually, for fake data generation we useFaker, with some small custom provider's. For assertions, we use the defaultdjangoanddjango-rest-frameworkunittestfeatures. We provide somemixinswith our own methods and some baseclasses.RoadmapAdd Basic Faker SupportAssertions APIExceptionsAssert Validation ErrorsCreate Faker ShortcutsWork with images and filesAssert Serializer ResponsesWork with paginationWork with multiple types of AuthenticationThis is an basic roadmap for the first version and, before the first version release, some new itens can be added here.
Package: djangorestframework-timed-auth-token
A new authentication backend for Django REST framework that uses a token with
an expiration date.  A new token is created every time a user logs in.  The
token expiration date is refreshed every time the token is used.  It supports
custom user modelsHow To UseAdd to your installed appsINSTALLED_APPS=(...'timed_auth_token',)Add the authentication class to the default authentication classesREST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework.authentication.BasicAuthentication','rest_framework.authentication.SessionAuthentication','timed_auth_token.authentication.TimedAuthTokenAuthentication',)}The app comes with a login URL at /login.  The endpoint expects two parameters:
username and password.url_patterns=[...# Can login by using /auth/loginurl(r'^auth/',include('timed_auth_token.urls',namespace='auth')),]After a successful login the response contains one key:token.{'token': 'lkjalsdjf8asdkjfal;kdfa8s;dlna;sdf'}To use this token to authenticate it must be included in the HTTP headers:Authorization: Token YOURTOKENConfigurationThe only available configuration option is the duration of the token.  It
defaults to 30 days.  You can set it either on the user model as an attribute
or as a setting in your settings.py.  If they are both set, the user model will
take precedence.Put it on your user model as an attributefromdatetimeimporttimedeltafromdjango.contrib.auth.modelsimportUserclassMyUserModel(User):token_validity_duration=timedelta(days=60)Put it in your settings.pyfromdatetimeimporttimedeltaTIMED_AUTH_TOKEN={'DEFAULT_VALIDITY_DURATION':timedelta(days=45)}CreditsStarting code (model, auth backend) thanks to Jake fromjh.gg.
Package: djangorestframework-types
djangorestframework-typesType stubs forDjango Rest Framework.Note: this project was forked fromhttps://github.com/typeddjango/djangorestframework-stubswith the goal of
removing themypyplugin dependency so
thatmypycan'tcrash due to Django
config, and that
non-mypytype checkers likepyrightwill work better with
Django Rest Framework.installpipinstalldjangorestframework-typesrelatedhttps://github.com/sbdchd/django-typeshttps://github.com/sbdchd/celery-typeshttps://github.com/sbdchd/mongo-typeshttps://github.com/sbdchd/msgpack-types
Package: djangorestframework-util
djangorestframework-util介绍基于DjangoRestFramework的通用代码软件架构软件架构说明安装教程xxxxxxxxxxxx使用说明xxxxxxxxxxxx参与贡献Fork 本仓库新建 Feat_xxx 分支提交代码新建 Pull Request特技使用 Readme_XXX.md 来支持不同的语言，例如 Readme_en.md, Readme_zh.mdGitee 官方博客blog.gitee.com你可以https://gitee.com/explore这个地址来了解 Gitee 上的优秀开源项目GVP全称是 Gitee 最有价值开源项目，是综合评定出的优秀开源项目Gitee 官方提供的使用手册https://gitee.com/helpGitee 封面人物是一档用来展示 Gitee 会员风采的栏目https://gitee.com/gitee-stars/
Package: djangorestframework-utils
djangorestframework-utils=========================|pypi-version| |build-status-image| |codecov|Overview--------Utilities for Django REST FrameworkRequirements-------------  Python (2.7, 3.3, 3.4)-  Django (1.6, 1.7, 1.8)-  Django REST Framework (3.0, 3.1)Installation------------Install using ``pip``\ ….. code:: bash$ pip install djangorestframework-utilsFeatures--------* VerboseMetadata (which is more verbose and not ambiguous like ``SimpleMetadata``)* modelserializer_factoryVerboseMetadata features------------------------* Add field's ``allow_null`` and ``default`` properties* Include ``pattern`` property for ``RegexField``* Include ``max_digits`` and ``decimal_places`` properties for ``DecimalField``For further information, see the [documentation](http://benzid_wael.github.io/djangorestframework-utils/docs).Example-------TODO: Write example.Documentation & Support-----------------------Full documentation for the project is available at `docs`_.You may also want to follow the `author`_ on Twitter... _tox: http://tox.readthedocs.org/en/latest/.. _author: https://twitter.com/benzid_wael.. |build-status-image| image:: https://secure.travis-ci.org/benzid-wael/djangorestframework-utils.svg?branch=master:target: http://travis-ci.org/benzid-wael/djangorestframework-utils?branch=master.. |codecov| image:: https://codecov.io/github/benzid-wael/djangorestframework-utils/coverage.svg?branch=master:target: https://codecov.io/github/benzid-wael/djangorestframework-utils?branch=master.. |pypi-version| image:: https://img.shields.io/pypi/v/djangorestframework-utils.svg:target: https://pypi.python.org/pypi/djangorestframework-utils
Package: djangorestframework-verbose-errors
Verbose ErrorsA simple package for DRF errors formattingRequirementsPython 3.6 or newerDjango 3.2 or newerDjango Rest Framework 3.14 or newerFormattingThis package provides the exception handler that formats handled DRF exceptions into verbose error responseGeneric error{"errors":[{"field":null,"messages":["You do not have enough permissions to perform this action"]}]}Error related to an object field{"errors":[{"field":"name","messages":["This field is required","This field can not be null"]}]}InstallationYou can install this package using pip:pipinstalldjangorestframework-verbose-errorsConfigurationConfigure your project in order to use the exception handler:REST_FRAMEWORK={'EXCEPTION_HANDLER':'rest_framework_verbose_errors.views.exception_handler',}LicenseMIT
Package: djangorestframework-versioning
Django REST Framework VersioningThis project aims to make it easy to support many different API versions in a Django REST Framework (DRF) project.DRFsupports several versioning schemesbut (perhaps wisely) sidesteps the issue of how to actually deal with the different versions in your code. To quote the docs: "How you vary the API behavior is up to you".This project provides some out-of-the box tools to handle versioning in views and serializers. The aim is to abstract away any versioning logic into a sort of "versioning layer" and allow the bulk of the code (and its developers) to focus on the latest behaviour.DocumentationPlease see the full documentationhere.AcknowledgementsThe approach taken in this project was inspired by Stripe's API version "compatibility layer", as described in blog posts byBrandur LeachandAmber Feng. I usedRyan Kaneshiro'sexcellent Django sketch as a starting point.I also want to thank my colleagues atTranzerfor encouraging me to work on this, and for being my guinea pigs / code duckies ❤️
Package: djangorestframework-xml
REST Framework XMLXML support for Django REST FrameworkFull documentation for the project is available athttp://jpadilla.github.io/django-rest-framework-xml.OverviewXML support extracted as a third party package directly from the official Django REST Framework implementation. It requires thedefusedxmlpackage only because it safeguards against some security issues that were discovered.Note: XML output provided is an ad-hoc format that isn't formally described. If you have specific XML requirements you'll need to write your own XML parsers/renderers in order to fully control the representation.RequirementsPython 3.5+Django 2.2+Django REST Framework 3.11+InstallationInstall usingpip...$pipinstalldjangorestframework-xmlExampleREST_FRAMEWORK={'DEFAULT_PARSER_CLASSES':('rest_framework_xml.parsers.XMLParser',),'DEFAULT_RENDERER_CLASSES':('rest_framework_xml.renderers.XMLRenderer',),}You can also set the renderer and parser used for an individual view, or viewset, using the APIView class based views.fromrest_frameworkimportrouters,serializers,viewsetsfromrest_framework_xml.parsersimportXMLParserfromrest_framework_xml.renderersimportXMLRendererclassUserSerializer(serializers.HyperlinkedModelSerializer):classMeta:model=Userfields=('url','username','email','is_staff')classUserViewSet(viewsets.ModelViewSet):queryset=User.objects.all()serializer_class=UserSerializerparser_classes=(XMLParser,)renderer_classes=(XMLRenderer,)Sample output<?xml version="1.0" encoding="utf-8"?><root><list-item><url>http://127.0.0.1:8000/users/1/.xml</url><username>jpadilla</username><email>jpadilla@example.com</email><is_staff>True</is_staff></list-item></root>Documentation & SupportFull documentation for the project is available athttp://jpadilla.github.io/django-rest-framework-xml.You may also want to follow theauthoron Twitter.
Package: djangorestframework-yaml
REST Framework YAMLYAML support for Django REST FrameworkFull documentation for the project is available athttp://jpadilla.github.io/django-rest-framework-yaml.OverviewYAML support extracted as a third party package directly from the official Django REST Framework implementation. It's built using thePyYAMLpackage.RequirementsPython (2.7, 3.3, 3.4)Django (1.6, 1.7)InstallationInstall usingpip...$pipinstalldjangorestframework-yamlExampleREST_FRAMEWORK={'DEFAULT_PARSER_CLASSES':('rest_framework_yaml.parsers.YAMLParser',),'DEFAULT_RENDERER_CLASSES':('rest_framework_yaml.renderers.YAMLRenderer',),}You can also set the renderer and parser used for an individual view, or viewset, using the APIView class based views.fromrest_frameworkimportrouters,serializers,viewsetsfromrest_framework_yaml.parsersimportYAMLParserfromrest_framework_yaml.renderersimportYAMLRenderer# Serializers define the API representation.classUserSerializer(serializers.HyperlinkedModelSerializer):classMeta:model=Userfields=('url','username','email','is_staff')# ViewSets define the view behavior.classUserViewSet(viewsets.ModelViewSet):queryset=User.objects.all()serializer_class=UserSerializerparser_classes=(YAMLParser,)renderer_classes=(YAMLRenderer,)Sample output----email:jpadilla@example.comis_staff:trueurl:"http://127.0.0.1:8000/users/1/"username:jpadillaDocumentation & SupportFull documentation for the project is available athttp://jpadilla.github.io/django-rest-framework-yaml.You may also want to follow theauthoron Twitter.
Package: django-rest-friendship
OverviewDRF endpoints for django-friendshipRequirementsPython (3.8, 3.9, 3.10)Django (3.2, 4.0)Django REST Framework (3.13.1)InstallationInstall usingpip…pipinstalldjango-rest-friendshipAdd rest_friendship to yourINSTALLED_APPSINSTALLED_APPS=(...'friendship',# Django friendship'rest_framework',# Django REST Framework'rest_friendship',# Django REST Friendship'rest_framework.authtoken',...)Also add settings forREST_FRIENDSHIPto your projectsettings.pyREST_FRIENDSHIP={'PERMISSION_CLASSES':['rest_framework.permissions.IsAuthenticated',],'USER_SERIALIZER':'rest_friendship.serializers.FriendSerializer',},And don’t forget to add the following to your projecturls.pyurlpatterns=[...path('',include('rest_friendship.urls')),...]ExamplesGet Friends Listcurl-LXGEThttp://127.0.0.1:8000/friends/-H'Authorization: Token 16bd63ca6655a5fe8d25d7c8bb1b42605c77088b'[{"id":1,"username":"testuser","email":"testuser@piboy.ca"}]Add/Remove Friendscurl-XPOSThttp://127.0.0.1:8000/friends/add_friend/-H'Authorization: Token 16bd63ca6655a5fe8d25d7c8bb1b42605c77088b'--data'to_user=testuser&message=Hello+friend'{"id":4,"from_user":"scott@gmail.com","to_user":"testuser@piboy.ca","message":"Hello friend","created":"2022-01-22T04:21:43.593950Z","rejected":null,"viewed":null}curl-XPOSThttp://127.0.0.1:8000/friends/remove_friend/-H'Authorization: Token 16bd63ca6655a5fe8d25d7c8bb1b42605c77088b'--data'to_user=testuser'[{"message":"Friend deleted"}]Accept a Request with request IDcurl-XPOSThttp://127.0.0.1:8000/friends/accept_request/-H'Authorization: Token 16bd63ca6655a5fe8d25d7c8bb1b42605c77088b'--data'id=1'{"message":"Request accepted, user added to friends."}TestingInstall testing requirements and run withpytest:pipinstalldjango-rest-friendship[test]pytestYou can also use the excellenttoxtesting tool to run the
tests against all supported versions of Python and Django. Install tox
globally, and then simply run:tox-sDocumentationTo build the documentation, you’ll need to installmkdocs.pipinstalldjango-rest-friendship[docs]To preview the documentation:$mkdocsserveRunningat:http://127.0.0.1:8000To build the documentation:mkdocsbuild
Package: django-rest-gen
django-rest-genThis generates a fully functioning apis using generated serializers and class-views.How to use itInstall it in your django projectpip install django-rest-gen.Run it and specify your apppython -m django-rest-gen. You should also
specify the appropriate arguments (e.g.,python -m django-rest-gen  --settings iires/settings.py --apppath iirapp)Note: if the file already exists and is not empty, the content will be printed instead in the stdoutArgumentsusage: django-rest-gen [-h] [--pythonpath PYTHONPATH] --settings SETTINGS --apppath APPPATH [--overwrite] [--dummy]

Generate Django REST API code

optional arguments:
  -h, --help            show this help message and exit
  --pythonpath PYTHONPATH
                        Python Path directory.
  --settings SETTINGS   The path to the django project settings
  --apppath APPPATH     The path to the app
  --overwrite           Whether to overwrite existing files if any
  --dummy               Whether to generate dummy data generatorLimitationsFlat. No nesting is provided as it depends on user preferences.Rebuild packagepython3 -m buildpython3 -m twine upload dist/*
Package: django-rest-hooks-delivery
Various deliverers fordjango rest hooksanddjango rest hooks ng.InstallationTo get the latest stable release from PyPipipinstalldjango-rest-hooks-deliveryTo get the latest commit from GitHubpipinstall-egit+git://github.com/PressLabs/django-rest-hooks-delivery.git#egg=rest_hooks_deliveryAddrest_hooks_deliveryto yourINSTALLED_APPSINSTALLED_APPS=(...,'rest_hooks_delivery',)Don’t forget to migrate your database./manage.pymigraterest_hooks_delivery# if you are using django > 1.7./manage.pysyncdbrest_hooks_delivery# if you are using django < 1.7UsageMake sure you have addedrest_hooks_deliveryto the list ofINSTALLED_APPSbeforedjango.contrib.adminand that you have
setHOOK_DELIVERERto one of the available deliverers. Currently onlyrest_hooks_delivery.deliverers.retryis available.### settings.py ###INSTALLED_APPS=[...'rest_hooks_delivery','django.contrib.admin',]HOOK_DELIVERER='rest_hooks_delivery.deliverers.retry'It also provides a management command useful for retrying failed hooks../manage.pyretry_failed_hooks
Package: django-rest-inherits-error-messages
Django Rest Error Inherits Error MessagesModelSerializer inherits the error_messages of the modelExamplepip install django-rest-inherits-error-messagesSet error_messages in your model field.
models.pyclass TestModel(django.db.models.Model):
    id = models.BigAutoField(primary_key=True)
    name = models.CharField(max_length=10, error_messages={'required':'[test] This field is required.'})Go to your ModelSerializer and inherit the InheritsModelSerializer (InheritsHyperlinkedModelSerializer also exists)class TestSerializer(InheritsModelSerializer):
    class Meta:
        model = TestModel
        fields = '__all__'If set as above, error_messages will be inherited.ContributionsIssues and PR are welcome.
Package: django-rest-jwt
drf-jwtJSON Web Token based authentication using Django REST Framework,
the JWTencoded in base64is put in the headers:Authorization: Bearer <token>install:pip install django-rest-jwtlet JWT do the authentification:add 'drf_jwt.authentication.JSONWebTokenAuthentication' in authentication classes:'DEFAULT_AUTHENTICATION_CLASSES':['drf_jwt.authentication.JSONWebTokenAuthentication',]make endpoints to login and get the JWT:fromdrf_jwt.controllersimportAuthurlpatterns=[path('api/login',Auth.as_view()),]suport GET and POSTPOST:{ login, password }login will be the username of theauthenticatefunction of djangoGET:return a JWT token if you are authenticateso, one could do a Basic Authentication to the GET endpoints to receve a JWT
Package: django-rest-kegg
Application of KEGG REST API with DRF(DjangoRestFramework)Installationpython3-mpipinstalldjango_rest_keggInstall App to Your Djanog Rest Project1 editproj/settings.pyINSTALL_APPS+=['rest_framework','django_rest_kegg']# the path to store image and conf filesKEGG_DB_PATH='./keggdb'2 editproj/urls.pyurlpatterns+=[path('kegg/',include('django_rest_kegg.urls')),]Initialize KEGG Database# migarate databasepython3manage.pymakemigrationsdjango_rest_kegg
python3manage.pymigrate# download image and conf files for all pathways# and build tablepython3manage.pybuild[--dbpathPATH][--drop]# everything is ok, enjoy it!python3manage.pyrunserverEndpoints/kegg/pathwaylist all pathways/kegg/pathway?path=<PATH>&type=<TYPE>&gene=<GENE>&color=<COLOR>path: a map number, eg. map00010type: conf, svg or png [default: png]color: default color [default: green]gene: genes to be highlighted, example formats:gene={"red":"K00886,K01222,K01223"}gene={"FF00FF":"K00886,K01222,K01223"}gene={"red":"K00886,K01222","blue":"K01610,K00918"}gene=["K00886,K01222,K01223"]gene=["K00886,K01222,K01223"]&color=pinkDemo Projectgitclonehttps://www.github.com/suqingdong/django_rest_kegg.gitcddjango_rest_kegg/demo

python3manage.pymakemigrationsdjango_rest_kegg

python3manage.pymigrate# Operations to perform:#   Apply all migrations: admin, auth, contenttypes, django_rest_kegg, sessions# Running migrations:#   Applying contenttypes.0001_initial... OK#   Applying auth.0001_initial... OK#   Applying admin.0001_initial... OK#   ...#   Applying django_rest_kegg.0001_initial... OK#   Applying sessions.0001_initial... OKpython3manage.pybuild

python3manage.pyrunserver
Package: django-rest-knox
django-rest-knoxAuthentication Module for django rest authKnox provides easy to use authentication forDjango REST
FrameworkThe aim is to allow
for common patterns in applications that are REST based, with little
extra effort; and to ensure that connections remain secure.Knox authentication is token based, similar to theTokenAuthenticationbuilt in to DRF. However, it overcomes some problems present in the
default implementation:DRF tokens are limited to one per user. This does not facilitate
securely signing in from multiple devices, as the token is shared.
It also requiresalldevices to be logged out if a server-side
logout is required (i.e. the token is deleted).Knox provides one token per call to the login view - allowing each
client to have its own token which is deleted on the server side
when the client logs out.Knox also provides an option for a logged in client to removealltokens that the server has - forcing all clients to re-authenticate.DRF tokens are stored unencrypted in the database. This would allow
an attacker unrestricted access to an account with a token if the
database were compromised.Knox tokens are only stored in a secure hash form (like a password). Even if the
database were somehow stolen, an attacker would not be able to log
in with the stolen credentials.DRF tokens track their creation time, but have no inbuilt mechanism
for tokens expiring. Knox tokens can have an expiry configured in
the app settings (default is 10 hours.)More information can be found in theDocumentationRun the tests locallyIf you need to debug a test locally and if you havedockerinstalled:simply run the./docker-run-tests.shscript and it will run the test suite in every Python /
Django versions.You could also simply run regulartoxin the root folder as well, but that would make testing the matrix of
Python / Django versions a bit more tricky.Work on the documentationOur documentation is generated byMkdocs.You can refer to their documentation on how to install it locally.Another option is to usemkdocs.shin this repository.
It will run mkdocs in adockercontainer.Running the script without any params triggers theservecommand.
The server is exposed on localhost on port 8000.To configure the port theservecommand will be exposing the server to, you
can use the following env var:MKDOCS_DEV_PORT="8080"You can also pass anymkdocscommand like this:./mkdocs build
./mkdocs --helpCheck theMkdocs documentationfor more.