Saravanan666/pypi-org huggingface dataset:
Package: django-salesman
Headless e-commerce framework for Django and Wagtail.Salesmanprovides a configurable system for building an online store.
It includes aRESTfulAPI with endpoints for manipulating the basket,
processing the checkout and payment operations as well as managing customer orders.FeaturesAPI endpoints forBasket,CheckoutandOrderSupport for as manyProducttypes needed using generic relationsPluggableModifiersystem for basket processingPaymentmethods interface to support any gateway necessaryCustomizableOrderimplementationFully swappableOrderandBasketmodelsWagtailandDjangoadmin implementationDocumentationDocumentation is available onRead the Docs.
Package: django-salesman-paypal
Salesman PayPalPayPalpayment integration forSalesman.InstallationInstall the package using pip:pipinstalldjango-salesman-paypalAdd to your setting file:INSTALLED_APPS=['salesman_paypal']SALESMAN_PAYMENT_METHODS=['salesman_paypal.payment.PayPalPayment']SALESMAN_PAYPAL_CLIENT_ID='<paypal-client-id>'SALESMAN_PAYPAL_CLIENT_SECRET='<paypal-client-secret>'SALESMAN_PAYPAL_SANDBOX_MODE=True# Disable in productionUsage guideTo use this payment on your website, checkout the official PayPal serverintegration guide.Seeexampledirectory in this repository for integration example using JavaScript.Additional settingsOptional additional settings that you can override:# Payment method label used when displayed in the basket.SALESMAN_PAYPAL_PAYMENT_LABEL='Pay with PayPal'# Default PayPal currency used for payments (https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/)SALESMAN_PAYPAL_DEFAULT_CURRENCY='USD'# URL to redirect to when PayPal payment is approved.SALESMAN_PAYPAL_RETURN_URL='/paypal/return/'# URL to redirect to when PayPal payment is cancelled.SALESMAN_PAYPAL_CANCEL_URL='/paypal/cancel/'# Default paid status for fullfiled orders.SALESMAN_PAYPAL_PAID_STATUS='PROCESSING'Advanced usageTo gain more control feel free to extend thePayPalPaymentclass with your custom functionality:# shop/payment.pyfromsalesman_paypal.paymentimportPayPalPaymentfromsalesman_paypal.confimportapp_settingsclassMyPayPalPayment(StripePayment):defget_paypal_payer_data(self,obj,request):# https://developer.paypal.com/api/orders/v2/#definition-payerdata=super().get_paypal_payer_data(obj,request)ifobj.userandobj.user.birth_date:data['birth_date']=obj.user.birth_date.strftime('%Y-%m-%d')returndatadefget_currency(self,request):currency=request.GET.get('currency',None)# Check currency is valid for PayPal...returncurrencyorapp_settings.SALESMAN_PAYPAL_DEFAULT_CURRENCYMake sure to use your payment method insettings.py:SALESMAN_PAYMENT_METHODS=['shop.payment.MyPayPalPayment']ThePayPalPaymentclass is setup with extending in mind, feel free to explore other methods.
Package: django-salesman-stripe
Salesman StripeStripepayment integration forSalesman.InstallationInstall the package using pip:pipinstalldjango-salesman-stripeAdd to your setting file:INSTALLED_APPS+=['salesman_stripe']SALESMAN_PAYMENT_METHODS=['salesman_stripe.payment.StripePayment']SALESMAN_STRIPE_SECRET_KEY='<stripe-secret-key>'SALESMAN_STRIPE_WEBHOOK_SECRET='<stripe-webhook-secret>'Local setupTo simulate webhooks while in development you can use theStripe CLI.
After you've installed the CLI, you can run:stripelisten--forward-tolocalhost:8000/api/payment/stripe/webhook/This will connect the webhook and output the signing secret forSALESMAN_STRIPE_WEBHOOK_SECRETsetting.Additional settingsOptional additional settings that you can override:# Payment method label used when displayed in the basket.SALESMAN_STRIPE_PAYMENT_LABEL='Pay with Stripe'# Default ISO currency used for payments (https://stripe.com/docs/currencies)SALESMAN_STRIPE_DEFAULT_CURRENCY='usd'# URL to redirect to when Stripe payment is cancelled.SALESMAN_STRIPE_CANCEL_URL='/stripe/cancel/'# URL to redirect to when Stripe payment is successfull.SALESMAN_STRIPE_SUCCESS_URL='/stripe/success/'# Default paid status for fullfiled orders.SALESMAN_STRIPE_PAID_STATUS='PROCESSING'Customer syncingIt is recommended to enable Stripe customer syncronization with your User model.
This will require an extra field on your User model which will hold the Stripe customer ID.
Easiest way to do this is to define a custom user model:# shop/models.pyfromsalesman_stripe.modelsimportStripeCustomerMixinclassUser(StripeCustomerMixin,AbstractUser):passYou should then register your custom user model insettings.py:AUTH_USER_MODEL='shop.User'An alternative approach would be to override theget_stripe_customer_idandsave_stripe_customer_idmethods in a customStripePaymentclass, see more in advanced usage section below.Advanced usageTo gain more control feel free to extend theStripePaymentclass with your custom functionality:# shop/payment.pyfromsalesman_stripe.paymentimportStripePaymentfromsalesman_stripe.confimportapp_settingsclassMyStripePayment(StripePayment):defget_stripe_customer_data(self,obj,request):# https://stripe.com/docs/api/customers/createdata=super().get_stripe_customer_data(obj,request)ifobj.userandobj.user.phone_number:data['phone']=obj.user.phone_numberreturndatadefget_currency(self,request):currency=request.GET.get('currency',None)# Check currency is valid for Stripe...returncurrencyorapp_settings.SALESMAN_STRIPE_DEFAULT_CURRENCYMake sure to use your payment method insettings.py:SALESMAN_PAYMENT_METHODS=['shop.payment.MyStripePayment']TheStripePaymentclass is setup with extending in mind, feel free to explore other methods.
Package: django-saltapi
===============Django Salt API===============This Django app serves as a REST API for Salt. It is basically a verything wrapper around the salt-api_ package... _salt-api: https://github.com/saltstack/salt-apiStatus------The main motivation behind creating a Django package to interface withSalt is that Django is already in our software stack. Since thensalt-api has become more flexible in the ways it can be deployed -- itis now possible to deploy its `rest_cherrypy`_ module on any compliantWSGI server (in contrast to running `salt-api` in a separate process).In addition to that there is an even slimmer alternative, though withless features, in the `rest_wsgi`_ module. I encourage you to have alook at them before deciding to use django-saltapi... _rest_cheerypy: http://salt-api.readthedocs.org/en/latest/ref/netapis/all/saltapi.netapi.rest_cherrypy.html.. _rest_wsgi: http://salt-api.readthedocs.org/en/latest/ref/netapis/all/saltapi.netapi.rest_wsgi.htmlSince salt-api has solved most of the motivations behind the inceptionof django-saltapi it is likely that this packages raison d'etre willbe to utilize more of the functionality in the Django REST Framework.Future developments will likely be towards this goal.This package comes with some caveats. This app compared to salt-api:- this app only supports x-www-form-urlencoded data input for the APIwrapper or input snarfed from the URL, whereas salt-api supportsother data formats- this app supports only JSON data output.. note:: Currently the API does not require authentication and twoAPI functions are exposed without CSRF protection, thoughthey are harmless from an integrity perspective. See`views.py` to enable authentication.Installation------------1. Add `django_saltapi` to your `INSTALLED_APPS` setting in yourproject `settings.py`::INSTALLED_APPS = ([...]'django_saltapi',)2. Add Salt settings in your project `settings.py`::SALT_CONFIG = {'master_config': '/etc/salt/master',}2. Include the package URLconf in your project `urls.py` like so::url(r'^api/salt/', include('django_saltapi.urls')),Usage-----.. note:: The documentation and some scripts refer to the host as"salt" where the API is running, YMMV.1. Visit http://salt/api/salt/ to view the default static HTML page.2. Issue a Salt ping to all minions via the Salt API wrapper::django-saltapi '*' test.ping3. Try out the explicitly exposed REST API functions (see views.py)::django-saltapi-ping alldjango-saltapi-echo all xdjango-saltapi-jobdjango-saltapi-job <jid>django-saltapi-miniondjango-saltapi-minion <mid>
Package: django-salted-api-tokens
django_salted_api_tokensDjango token authentication with hashed, salted tokensDjango model with token id and token protected with hash and saltAuthentication class using protected api tokens.1. Githubhttps://github.com/harisankar-krishna-swamy/django_salted_api_tokens2. Installpip install django_salted_api_tokens3. ConfigurationAddDSAT_TOKEN_LENGTHinsettings.pyDefault:80Max length:256AddDSAT_MAX_TOKENS_PER_USERinsettings.py. Maximum number of tokens allowed per user.
Subsequent requests for tokens will be rejected.Default:10AddDSAT_HASHLIB_ALGOinsettings.py. A string representing the hash algorithm from hashlib.Supported values are 'sha512', 'sha256', 'sha384'
Default:sha512ExampleDSAT_TOKEN_LENGTH=80DSAT_MAX_TOKENS_PER_USER=10DSAT_HASHLIB_ALGO='sha512'Adddjango_salted_api_tokensto installed apps along withrest_framework.ExampleINSTALLED_APPS=[...'rest_framework','django_salted_api_tokens',...]Add salted tokens authentication class toREST_FRAMEWORKinsettings.py.ExampleREST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':['django_salted_api_tokens.authentication.TokenAuthentication',],}Add url to obtain token in your projecturls.py.Exampleurlpatterns=[...path('dsat/',include('django_salted_api_tokens.urls')),...]Runpython manage.py migrateto create model tables.4. UsageThe url to obtain token will be available atdsat/create-dsat/.
Example local urlhttp://127.0.0.1:8000/dsat/create-dsat/4.1 curl exampleCreate a user with password in your Django project.# obtain token for user

curl -X POST -H "Content-Type: application/json" -d '{"username":"bob", "password":"bobspassword"}' http://127.0.0.1:8000/dsat/create-dsat/
{"token_id":"10bac501884e35723d7f28a63ddf845c656bd857",
"token":"9ec12fad574c0d6580e78f9f104f485ebad2eceea06cc9505c290bc0abce4d6ec1e85f1e25b8b04f",
"message":"These credentials will be lost forever if not stored now"}

# use token in a rest view using Authorization header
# Header format is token token_id token
curl -H "Authorization: token 10bac501884e35723d7f28a63ddf845c656bd857 9ec12fad574c0d6580e78f9f104f485ebad2eceea06cc9505c290bc0abce4d6ec1e85f1e25b8b04f"  http:/127.0.0.1:8000/accounts/an-authenticated-view/
{"message":"Hello, World!"}See example_django_project in source5. LicenseApache2 License6. See alsoDSAT provides a basic protection of tokens Vs clear tokens. Read Python docs athttps://docs.python.org/3/library/hashlib.html
Package: django-samesite-none
Middleware to work around#30862Chrome started rolling out changes that brake Django sites with intentionally
emptySameSitecookie settings.This middleware sets the value"None"on those cookies explicitly.
Also setsSecuretoTruefor all altered cookies.InstallationGet it from PyPi:pipinstalldjango-samesite-nonePut it first in theMIDDLEWARElist in yoursettings.py:MIDDLEWARE = [
    "django_samesite_none.middleware.SameSiteNoneMiddleware",
    ...
]
Package: djangosaml2
djangosaml2A Django application that builds a Fully Compliant SAML2 Service Provider on top of PySAML2 library.
Djangosaml2 protects your project with a SAML2 SSO Authentication.Features:HTTP-REDIRECT SSO BindingHTTP-POST SSO BindingSLO POST and HTTP-REDIRECT BindingDiscovery Serviceembedded Wayf page with customizable html templateIdP HintingIdP ScopingSamesite cookiePlease consult theofficial Documentation of djangosaml2to get started.ContributingPlease open Issues to start debate regarding the requested
features, or the patch that you would apply. We do not use
a strict submission format, please try to be more concise as possible.The Pull Request MUST be done on the dev branch, please don't
push code directly on the master branch.Special thanksThis is a community-driven project, born as a
fork and maintained by different authors at different times, such as:Lorenzo Gil SanchezJozef knaperek
Package: django-saml2-auth-idperror-redirect
django-saml2-auth-idperror-redirectA plugin to redirect users to a URL (usually the login page) in response to an authentication error indjango-saml2-auth.IntroductionBy default,django-saml2-authredirects users to the:deniedpage in response to authentication errors.django-saml2-auth-idperror-redirectwill instead redirect the user to another URL (or view), usually the
login page.ExampleIn settings.py:INSTALLED_APPS += (
    ...
    'django_saml2_auth',
    # ensure the plugin is loaded
    'django_saml2_auth_idperror_redirect',
    ...
)

# this is the "usual" config object from django-saml2-auth
SAML2_AUTH = {
    'DEFAULT_NEXT_URL': '/',
    'PLUGINS': {
        # use this package in lieu of DEFAULT IDP Error plugin 
        'IDP_ERROR': ['REDIRECT'],
    },
    # must provide a URL or VIEW
    'IDP_ERROR_REDIRECT_VIEW': 'login',
    'IDP_ERROR_REDIRECT_URL': 'https://...',
    # whether or not to include a next=<url> query argument
    'IDP_ERROR_REDIRECT_NEXT': True,
}
Package: django-saml2-auth-metadata-inline
A plugin to support inline metadata configuration in django-saml2-auth# IntroductionBy default, django-saml2-auth only supports metadata from a local file or a remote URL.  The underlying library supports“inline” metadata i.e. a string in the settings file.  This makes it possible to follow the [12factor]()methodology because an environment variable can be used to provide this “inline” data.# ExampleIn settings.py:INSTALLED_APPS += (…‘django_saml2_auth’,# ensure the plugin is loaded‘django_saml2_auth_metadata_inline’,…)# this is the “usual” config object from django-saml2-authSAML2_AUTH = {‘DEFAULT_NEXT_URL’: ‘/’,‘PLUGINS’: {# use this package in lieu of DEFAULT metadata plugin (or list both)‘METADATA’: [‘INLINE’],}# plugin looks for configuraiton here‘METADATA_XML_STRING’:  os.environ.get(‘SAML_CONFIG’)}Keywords: Django SAML2 Plugin for Inline Metadata
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Framework :: Django :: 1.5
Classifier: Framework :: Django :: 1.6
Classifier: Framework :: Django :: 1.7
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Package: django-saml2-auth-signout-redirect
django-saml2-auth-signout-redirectA plugin to redirect users to a URL (usually an ADFS logout URL) in django-saml2-authIntroductionBy default, django-saml2-auth only signs out users in the local Django application.  For security reasons,
the logout needs to be passed to the IdP (identity provider).  Otherwise, a user who clicks the login
button will be logged in again without providing a password (or otherwise).  If you are able to sign the request
(i.e. provide a cert and key), please seedjango-saml2-auth-signout-slo.  If you are not able -- or do not
want -- to sign the logout request, this plugin is your next-best option.  Instead of a true Single SignOut,
this plugin will let you redirect the user to the IdP's logout page, defaulting to the ADFSidpinitiatedsigninpage.ExampleIn settings.py:INSTALLED_APPS += (
    ...
    'django_saml2_auth',
    # ensure the plugin is loaded
    'django_saml2_auth_signout_redirect',
    ...
)

# this is the "usual" config object from django-saml2-auth
SAML2_AUTH = {
    'DEFAULT_NEXT_URL': '/',
    'PLUGINS': {
        # use this package in lieu of DEFAULT signout plugin 
        'SINGOUT': ['REDIRECT'],
    },
    # optionally specify the URL
    'LOGOUT_REDIRECT_URL': 'https://<idp.com>/<logout>
}ADFSBy default, this package redirects a user to<SSO Endpoint>/idpinitiatedsignon.aspxwhich provides manual
login/logout on ADFS servers.  Unless you're using an unconventional SSO path, this should work out-of-the-box.
Package: django-saml2-auth-signout-slo
django-saml2-auth-signout-sloA plugin to support Single LogOff (SLO) in django-saml2-authIntroductionBy default, django-saml2-auth only signs out users in the local Django application.  For security reasons,
the logout needs to be passed to the IdP (identity provider).  Otherwise, a user who clicks the login
button will be logged in again without providing a password (or otherwise).ExampleIn settings.py:INSTALLED_APPS += (
    ...
    'django_saml2_auth',
    # ensure the plugin is loaded
    'django_saml2_auth_signout_slo',
    ...
)

# this is the "usual" config object from django-saml2-auth
SAML2_AUTH = {
    'DEFAULT_NEXT_URL': '/',
    'PLUGINS': {
        # use this package in lieu of DEFAULT signout plugin 
        'SINGOUT': ['SLO'],
    }
    # django_saml2_auth doesn't support these natively so the package injects them
    'SIGNOUT_SLO': {
        'CERT': <tbd>
        'KEY': <tbd>
    }
}Microsoft AD FSWARNING:  ADFS SLO will not work with unsigned requests.  This means that you must provide a key and a cert and upload
the cert to the ADFS Relaying Party Trust.  If you cannot -- or do not want to -- provide a certificate, see the-django-saml2-auth-signout-redirectplugin.  Instead of a true Single SingOut, this plugin will redirect the user to
theidpinitiatedsignonpage, permitting the user to complete the signout manually.There are several issues using this package with ADFS:ADFS does not provide a NameID by default.  NameID is required (at least by PySAML2) for SLO.ADFS does not expose an SLO endpoint by default.The following are one way to address these issues (but use at your own risk).  The Name ID strategy was taken fromthis article.  The SLO
endpoint was taken fromthis article.In your SAMLConfig, add the line:'NAME_ID_FORMAT': 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',In your ADFS Claim Rules, add a custom rule ("Send Claims Using a Custom Rule"):c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=> add(
    store = "_OpaqueIdStore",
    types = ("http://mycompany/internal/persistentId"),
    query = "{0};{1};{2}",
    param = "ppid",
    param = c.Value,
    param = c.OriginalIssuer
);In your ADFS Claim Rules, add a Transform Rule:Incoming claim type:http://mycompany/internal/persistentId(literally this, don't change mycompany)Outgoing claim type:NameIDOutgoing name ID format:Persistent IdentifierUnder the Relaying Party Trust'sProperties->Endpointstab, add a SAML Logout Endpoint:Binding:POSTTrusted URL:  Your ADFS endpoint, something likehttps://<my.adfs.com>/adfs/lsResponse URL:  emptyUnder the Relaying Party Trust'sProperties->Endpointstab
Package: django-sample-data-generator
Installpipinstalldjango-sample-data-generatorUsageSettingsINSTALLED_APPS=(# ...'django_sample_generator',)SAMPLE_DATA_GENERATORS=('blog.generators',)Example# blog/generators.pyfromdjango_sample_generatorimportgeneratorfrom.modelsimportBlogclassBlogGenerator(generator.ModelGenerator):classMeta:model=Bloggenerators=[BlogGenerator(10),# 10 blogs]pythonmanage.pycreate_sample_data
Package: django-samplemed-user-api
This is a generic sample of code for api test installation. To be used as an
app to create api endpoints using DRF.The steps for installation are as follow:Detailed documentation is in the “docs” directory.Quick startInstall “rest_framework”:`pip install djangorestframework`Once installed add therest_frameworkinto your “INSTALLED_APPS” in yoursettings.py:INSTALLED_APPS = [
    ...
    'rest_framework',
]Installsamplemed_users_api:``pip install samplemed_users_api``Once installed add the “User” app into yourINSTALLED_APPinsettings.py:INSTALLED_APPS = [
    ...
    'rest_framework',
    'Users',
]Make db migrations to make the app work:``python manage.py makemigrations``Migrate the changes:``python manage.py migrate``Add the urls from “User” app into your main url:``from django.conf.urls import include``URL path that will display as default
admin and the empty path as the API endpoints (router.urls):urlpatterns = [
    path('admin/', admin.site.urls),
    path('users/', include("Users.urls")),
]Go to  “https://your.url.com/users/” and see the endpoints.
Package: django-samprojectpolls
Polls is a simple Django app to conduct Web-based polls. For each
question, visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'polls',
]Include the polls URLconf in your project urls.py like this:path('polls/', include('polls.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/polls/to participate in the poll.
Package: django-sandstorm
[![PyPI](https://img.shields.io/pypi/v/django-sandstorm.svg)](https://pypi.python.org/pypi/django-sandstorm)# django-sandstormDjango package for helping integrate a django app with sandstorm.ioTo use:`pip install django-sandstorm`It is HIGHLY recommended you make a separate sandstorm settings file for yourapp. Whether or not you do, the following needs to go in your app settings forintegration with sandstorm to work:```INSTALLED_APPS += ('django_sandstorm',)AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.RemoteUserBackend',)MIDDLEWARE_CLASSES += ('django_sandstorm.middleware.SandstormMiddleware',)```
Package: djangosanetesting
django-sane-testing integrates Django with Nose testing framework. Goal is to provide nose goodies to Django testing and to support feasible integration or functional testing of Django applications, for example by providing more control over transaction/database handling.Thus, there is a way to start HTTP server for non-WSGI testing - like using Selenium or Windmill.Selenium has also been made super easy - just start –with-selenium, inherit from SeleniumTestCase and use self.selenium.Package is documented - see docs/ orhttp://readthedocs.org/projects/Almad/django-sane-testing/docs/index.html.