Saravanan666/pypi-org huggingface dataset:
Package: django-shibboleth-session-auth
shibboleth_session_authSimplistic Shibboleth integration for Django sessionsThis is a very simple way of allowing users to be authenticated via
Shibboleth but to be a part of Django groups and users. This is
accomplished by using Apachemod_shibto protect the provided view.
If the user is able to authenticate then we extract certain details from
the data provided by Shibboleth. The view will create Django Users and
Groups as necessary.Apache ConfigThis code has only been tested withmod_shibfor Apache.Here’s the config we use:<Location /shibboleth-sso/>
  AuthType shibboleth
  ShibCompatWith24 On
  ShibRequestSetting requireSession true
  Require shib-attr member staff
/Location>You may want to tweak or remove theRequireline depending on your
needs. As it is, it requires users to be a member of groupstaffin
order to be able to authenticate.Django SetupYou’ll need to add an entry in yoururls.py, similar to this:fromshibboleth_session_auth.viewsimportshibboleth_session_authurlpatterns+=[url(r'^shibboleth-sso/',shibboleth_session_auth,name="esnet-sso"),]Note that we useshibboleth-ssoboth here and in the Apache config.Django SettingsSHIBBOLETH_SESSION_AUTH={'IDP_ATTRIBUTE':'Shib-Identity-Provider','AUTHORIZED_IDPS':['https://${YOUR_IDP}/idp/shibboleth',],## note that we use Apache environment variables directly rather than the# HTTP_xxx variables which are derived from the HTTP request headers.# The HTTP_xxx variety is vulnerable to potential spoofing#'USER_ATTRIBUTES':[('uid','username',True),('mail','email',True),('givenName','first_name',False),('sn','last_name',False),],'GROUP_ATTRIBUTE':'member','GROUPS_BY_IDP':{},'DJANGO_STAFF_GROUP':'webadmin',}IDP_ATTRIBUTEdefines which Apache environment variable carries the
name of the IdP.AUTHORIZED_IDPSis a list of IdPs that we trust. The full URL may
vary for your setup – please check this with whomever runs your IdP..USER_ATTRIBUTESa list of tuples which are used to map from the
attribute names provided by the IdP to fields to be used with the Django
User model. The format is (idp_attribute,django_model_attribute,required).GROUP_ATTRIBUTEis the name used by the IdP to provide group
membership. The user will be added to each group listed in the group
attribute. If the group does not already exist it will be created.
Groups are assumed to be separated by a semicolon (;) in the data
provided by the IdP.GROUPS_BY_IDPthis is a dictionary mapping an IdP (fromAUTHORIZED_IDPS) to a list of groups. If the user is authenticated
to the named IdP then the user will be added to each of the groups,
creating the groups as necessary.DJANGO_STAFF_GROUPis the name of the group presented by the IdP
that will be used to determine if the user has theis_staffbit set
or not.We assume the the IdP is the source of truth for groups and for whether
or not a user should have Django staff privileges. This means that the
set of groups the user will be a member of will be exactly the set of
groups that the IdP sends. This also means that if the user is no longer
a member ofDJANGO_STAFF_GROUPthat they will lose their staff
privileges.
Package: django-shift-work
Middleware to check what shift is currently activeDocumentationThe full documentation is athttps://django-shift-work.readthedocs.io.QuickstartInstall Django Shift Work:pip install django-shift-workAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_shift_work.apps.DjangoShiftWorkConfig',...)Add Django Shift Work’s URL patterns:fromdjango_shift_workimporturlsasdjango_shift_work_urlsurlpatterns=[...url(r'^',include(django_shift_work_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2019-03-17)First release on PyPI.
Package: django-ship
Shipping is an app to use Post Office services for e-commerces built with Django.Quick startAdd “shipping” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'shipping',
)Include the shipping URLconf in your project urls.py like this:url(r'^shipping/', include('shipping.urls')),Runpython manage.py syncdbto create the shipping models.Visithttp://127.0.0.1:8000/to view a sample with a shipping service
Package: django_shipments
python-ups==========UPS shipping interfaceUsing=======from ups.client import UPSClientfrom ups.model import Package, Addresscredentials = {'username': '','password': '','access_license': '','shipper_number': ''}shipper = Address(name='shipper address name', city='rio de janeiro',address='', state='', zip='',country='brazil')recipient = Address(name='shipper address name', city='rio de janeiro',address='', state='', zip='',country='brazil')packages = [Package(2, 3, 4, 5)]ups = UPSClient(credentials)response = ups.rate(packages=packages, packaging_type='2a',shipper=shipper, recipient=recipient)
Package: django-shipping
django-shipping===============Django Shipping is a django application that provides integration with Correios (federal brazilian carrier) and UPS (international carrier).## InstallationAnyway, let's install this bitch! The first thing you'll want to do is run:``` bash$ pip install django-shipping```Put ``shippging`` in your ``INSTALLED_APPS``:``` python# settings.pyINSTALLED_APPS = (# ...'shipping',)```Put ``shipping.urls`` in your ``urls.py``:``` python# urls.pyfrom django.conf.urls.defaults import patterns, include, urlfrom django.contrib import adminadmin.autodiscover()urlpatterns = patterns('',# ...url(r'^shipping/', include('shipping.urls')),url(r'^admin/', include(admin.site.urls)),))```You need to run shipping migrations. We use [south](http://south.readthedocs.org/en/latest/index.html) for this, go to your ``project`` dir and make:``` bash$ python manage.py migrate shipping```## UsingNow, start your django application and go to admin:``` bash$ python manage.py runserver```In django's admin you wi'll see the shipping models: ``Zone``, ``Country``, ``State``, ``Bin``, ``UPSCarrier`` and ``CorreiosCarrier``. You need to create one instance for each carrier that you'll usefor shipping.
Package: django-shirow
Django ShirowTo connect to the RPC servers based onShirow, clients have to be
authenticated using theDjango authentication
system. Thus,
the package provides thecreate_token_if_neededdecorator which is
intended for Django views. First, the decorator tries to obtain a token
from Redis. Then, in case the try doesn’t succeed,create_token_if_neededwill create and put it into Redis and the
user’s session. Finally, the client can get the token from the session
and prove the RPC server he/she is an authenticated user.The decorator uses JWT for generating tokens. JWT (JSON Web Token) is
the open standard defined inRFC
7519.Installation$ pip install django-shirowUsageThis Django application uses the following configuration keys:SECRET_KEYis a string which contains a secret. Django uses the
configuration key forcryptographic
signing,
butcreate_token_if_neededuses it for signing the tokens, using
the algorithm specified byTOKEN_ALGORITHM_ENCODING(see below).TOKEN_TTLis a number which contains a time-in-seconds value. It
indicates how long tokens are considered valid. IfTOKEN_TTLis
not set, then TTL is set to900(15 minutes).TOKEN_ALGORITHM_ENCODINGis a string which containsone of the
algorithmsused for signing tokens. IfTOKEN_ALGORITHM_ENCODINGis not set,
then the algorithm is set toHS256.REDIS_HOSTis a string which contains the Redis host. IfREDIS_HOSTis not set, then the host is set to127.0.0.1.REDIS_PORTis a number which contains the port the Redis server
listens on. IfREDIS_PORTis not set, then the port is set to6379.
Package: django-shop-ajax
This app adds some nifty ajax functions you can use with django SHOP.InstallationThis requires jQuery (http://jquery.com/) and django SHOP to work (https://github.com/divio/django-shop)Addshop_ajaxto yourINSTALLED_APPSin your settings.pyOn your server runpython manage.py collectstaticto collect all app’s static filesAlternatively, you can just copy the content of shop.js in your javascript files.UsageImport the javascript files<script type="text/javascript" src="{{ STATIC_URL }}shop_ajax/shop.js"></script>Initialize the SHOP.cart somewhere on the top of your javascript code by providing it acsrf_tokenand urls to corresponding viewsSHOP.cart.init('{{ csrf_token }}', '{% url cart_item_add %}', '{% url cart_item_add %}', '{% url cart_delete %}');Use the provided functions in your templates<a href="#" onclick="SHOP.cart.addItem({{ product.id }})">Add to cart</a>
...
Package: django-shop-bitpagos
django-shop-bitcoinBitPagos Bitcoin Payment Backend for Django ShopThis applicaiton is a bitpagos backend for django-SHOP, or any other shop system implementing its shop interface.Usage1.
Add django-paypal and this project to your INSTALLED_APPS::INSTALLED_APPS = (
...
'shop_bitpagos',
...
)2.
Add ‘shop_bitpagos.offsite_bitpagos.BitPagosBackend’ to django-SHOP’s SHOP_PAYMENT_BACKENDS setting.3.
Make sure you set following in settings.py:SHOP_BITPAGOS_KEY#found it athttps://www.bitpagos.net/api/settings/Optional settings:SHOP_BITPAGOS_CURRENCY#default USD4.
Set bitpagos notification url to:http://www.yoursite.com/shop/pay/bitpagos/ipn/# /shop depends on the prefix used for django-shop5.
Set a cron to run periodically:python manage.py bitpagos_checkContributingFeel free to write any comment or suggestion for this project tosebastian@bitpagos.net
Package: django-shop-bulkform
All this plugin does is give you access to a “bulk” order form that
lists all the products in your site with quantity boxes and adds
them to the cart on submission. Not rocket science.It also may not work for every shop. If you have more than 25 or so
items, a page that lists them all could get unwieldy. But if you
only have a small number of items and want an easy view to let
people add multiple products at the same time, this is your plugin.
Package: django-shopcart
========Shopcart========Shopcart is a simple app created for the class requirement.Detailed documentation (if any!) is with in the source files as comments.(I'd suggested to go through the source, since that would be an easier task than tofigure out manually)Quick start-----------1. Add "shopcart" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'shopcart',]2. Include the shopcart urlconf in your project urls.py like this::urlpatterns = [...url(r'^shopcart/', include('shopcart.urls')),]3. Start the development server and visit http://127.0.0.1:8000/shopcart/ to view theshopcart app
Package: django-shop-catalog
django-shop-catalog===================Catalog app for django SHOP.:Version: 0.0.3:Source: https://github.com/dinoperovic/django-shop-catalog:Dev Status: AlphaFind starting templates in `django-shop-catalog-templates`_ repo.Requirements------------.. code:: textdjango>=1.6,<1.8django-cms>=3.0.1django-shop>=0.2.0django-filer>=0.9.5django-mptt>=0.6.0django-hvad>=0.4.0measurement>=1.7.2django-currencies>=0.3.2Installation------------Install with pip:.. code:: bashpip install django-shop-catalogInstall from github using pip:.. code:: bashpip install -e git://github.com/dinoperovic/django-shop-catalog.git@master#egg=django-shop-catalogGetting Started---------------Setup `django-cms`_, `django-shop`_, `django-filer`_, `django-hvad`_ and `django-currencies`_.Your ``INSTALLED_APPS`` should look something like this:.. code:: pythonINSTALLED_APPS = ['djangocms_admin_style','django.contrib.admin','django.contrib.auth','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','django.contrib.sites','cms','mptt','menus','south','sekizai','djangocms_text_ckeditor','filer','easy_thumbnails','currencies','hvad','shop','catalog',# Optional catalog apps.'catalog.orders','catalog.addresses','catalog.reviews',]Add to your ``settings.py``:.. code:: pythonSHOP_PRODUCT_MODEL = 'catalog.models.Product'SHOP_CART_MODIFIERS = ('catalog.cart_modifiers.CatalogCartModifier',)# If you're using 'catalog.orders' app.SHOP_ORDER_MODEL = 'catalog.orders.models.Order'# If you're using 'catalog.addresses' app.SHOP_ADDRESS_MODEL = 'catalog.addresses.models.Address'Add to your patterns in ``urls.py``:.. code:: pythonurlpatterns = i18n_patterns('',url(r'^admin/', include(admin.site.urls)),url(r'^currencies/', include('currencies.urls')),# Include catalog shop_urls before django-shop urls.url(r'^shop/', include('catalog.shop_urls')),url(r'^shop/', include('shop.urls')),# You can include catalog urls here or use django-cms app hook.url(r'^catalog/', include('catalog.urls')),url(r'^', include('cms.urls')),)Run:.. code:: bashpython manage.py syncdb --allpython manage.py migrate --fakeInstall `django-shop-catalog-templates`_ to get started quickly.Notes-----If your're using ``catalog.addresses`` app, you can run this commandto have all countries and regions pulled from `geonames.org`_... code:: bashpython manage.py initcountriesChangelog------ 0.0.3 Update noconflict script- 0.0.2 Bugfix:+ Add locale directory to MANIFEST.in- 0.0.1 Initial Alpha release.. _django-cms: https://github.com/divio/django-cms.. _django-shop: https://github.com/divio/django-shop.. _django-shop-catalog-templates: https://github.com/dinoperovic/django-shop-catalog-templates.. _django-filer: https://github.com/stefanfoulis/django-filer.. _django-hvad: https://github.com/kristianoellegaard/django-hvad.. _django-currencies: https://github.com/panosl/django-currencies.. _geonames.org http://geonames.org/
Package: django-shop-categories
A extendable category app using django-mptt for django-shop.InstallationFor the current stable version:pip install django-shop-categoriesFor the development version:pip install -e git+git://github.com/fivethreeo/django-shop-categories.git#egg=django-shop-categoriesRunning tests:git clone git://github.com/fivethreeo/django-shop-categories.git
cd django-shop-categories
virtualenv test_env
source ./test_env/bin/activate
pip install -r requirements.txt
python runtests.pyConfigurationAddshop_categoriestosettings.INSTALLED_APPS.SetSHOP_PRODUCT_MODELtoshop_categories.models.defaults.product.default.CategoryProduct.In your urls.py add thisbeforeyour shop patterns:urlpatterns += patterns('',
    url(r'^catalog/', include('shop_categories.urls')),
)Then run:manage.py syncdbExtending the Category modelIn your own app make a models dir with __init__.py and a category.py dir, like so:app/models/__init__.py
app/models/category.pyNote: Do not import the model from category.py in __init__.py, the model should NOT be in a “real” models module as this will cause the overridden Category model to be defined twice.In category.py:from django.db import models
from shop_categories.models.defaults.category.base import ProductCategoryBase

class Category(ProductCategoryBase):

    image = models.ImageField(upload_to='categoryimages/', null=True, blank=True)

    class Meta:
        abstract = False
        app_label = 'app'SetSHOP_CATEGORIES_CATEGORY_MODELtoapp.models.category.CategoryRegister your custom category model in admin.py:from shop_categories.models import Category
from shop_categories.admin import ProductCategoryAdmin

admin.site.register(Category, ProductCategoryAdmin)Then, assuming your Product model is not already synced, run:manage.py syncdbExtending the Product modelWhen extending Product models in your shop make sure they subclass fromshop_categories.models.defaults.product.base.CategoryProductBaseto add the Category Foreignkey and M2M fields.Example implementationAn example of a django-shop with django-shop-categories can be found here:https://github.com/fivethreeo/django-shop-example
Package: django-shop-ceca
====================django-shop-ceca====================This module is a payment backend module for django-SHOP, for the CECA TpvInstallation============Using pip::pip install django-shop-cecaTPV Configuration in django shop====================In order to shop ceca to work, you will need to include 'shop_ceca' in your INSTALLED_APPINSTALLED_APP = (...'shop_ceca')After that, you will need to especify the tpv configuration in settingsSHOP_CECA = {"merchant_id": "...","acquirer_bin": "...","clave_encriptacion": "....","terminal_id": "....",'TEST': True  # Set to true if you want the test eviroment.}* Shop configurationAdd 'shop_ceca.offsite_ceca.OffsiteCecaBackend' to SHOP_PAYMENT_BACKENDSSHOP_PAYMENT_BACKENDS = ('shop_ceca.offsite_ceca.OffsiteCecaBackend',)Changes====================0.1.0: First release to the public.
Package: django-shop-configurableproduct
This plugin allow you to:Define product types in django admin interface with custom set of fieldsAdd custom fields to productsSupported field typesFloat fieldChar fieldImage field (with preview in admin via sorl.thumbnail)Boolean field (NullBooleanField)How to use itInstall from bitbucket or pypiIf you want to define static fields for all product types (i.e. size, …):Create a subclass of configurableproduct.models.CProductWrite admin class based on configurableproduct.admin.CProductAdminIf you want to use CProduct model directly, setENABLE_CPRODUCT_ADMINtoTruein your settings file.You can access custom fields viaproductfloat_set,productchar_set,… as:product_object.productchar_set.all()[0].valueYou can access ordered list of custom fields viaproduct_object.field_listproperty
Package: djangoshop-currencies
Django-SHOP integration withdjango-currenciesIntroductionThis module allows Django-SHOP implementations to integrate live
currency feeds. This will allow you to offer your shop product prices
in the user’s chosen currency.The module is currently compatible with Django v1.10.7. This
documentation assumes a working knowledge of Django andDjango-SHOP.Release History0.2.x -Django-SHOPv0.11.x compatibility0.1.x -Django-SHOPv0.10.2 compatibilityTODOPlease let me know of you have any feature suggestions, or wish to
implement any of the below:Fix for the db initialisation warning below.Tests.Continuous build integration including compatibility testing with
various python, Django and Django-SHOP versions.ConfigurationFollow the Readme fordjango-currencies.
Install this module through pip:pip installdjangoshop-currencies.The Django-SHOP Money system has been extended to use django-currencies as a currency conversion backend.
To enable this functionality your currencies configuration must satisfy the following requirements:ISO4217Exponent and symbol populating using./manage.py currencies iso(This automatically imports the currencies set in theSHOP_CURRENCIESsetting)Currency factors populating using./manage.py updatecurrencies yahoo(This also sets the base currency toSHOP_DEFAULT_CURRENCY)Some currencies set to active in the admin interfaceWarningThecurrenciesdatabase tablemustbe initialised before any Django app can import the included money types.
Unfortunately the./manage.pycommand will automatically import a lot of modules when they are configured in
INSTALLED_APPS causing an error which prevents you from running./manage.py migrate, etc.As a workaround before a permanent solution is found:Create a minimal settings file which will be used temporarily to allow the currencies table of your database to be populated. As an example,one is included here.Runpython manage.py migrate--settingsshop_currencies.min_settings(or use your minimal settings file)Satisfy requirements 1. & 2. above & append--settings<min_settings>to the commandsRunpython manage.py migrateRunpython manage.py createsuperuserto create an admin userSatisfy requirement 3. aboveOnce created, I recommend dumping your base currency as a fixture for subsequent use when initialising databases:pythonmanage.pydumpdata--indent2--outputfixtures/currency.json--pks1currencies.currencypythonmanage.pyloaddata--settingsshop_currencies.min_settingsfixtures/currency.jsonUsageReplace theDefaultCartModifierwith the providedCurrencyCartModifierin your shop settings:SHOP_CART_MODIFIERS=(# provides the default cart lines'shop_currencies.modifiers.CurrencyCartModifier',...Use the Money conversion extension which provides theto(code)function as below.
The additionalbaseargument is used by the cart modifier.fromdjango.dbimportmodelsfromcurrencies.utilsimportget_currency_codefromshop_currencies.money.fieldsimportMoneyFieldclassMyModel(models.Model):unit_price=MoneyField()...defget_price(self,request,base=False):ifbase:returnself.unit_priceelse:session_currency_code=get_currency_code(request)returnself.unit_price.to(session_currency_code)
Package: djangoshop-gestpay
# djangoshop-gestpay[![PyPI version](https://img.shields.io/pypi/v/djangoshop-gestpay.svg)](https://pypi.python.org/pypi/djangoshop-gestpay)[GestPay](https://www.gestpay.it) Payment Integration for [djangoSHOP](http://www.django-shop.org).—## Requirements[django-shop][gestpypay]## InstallationInstall usingpip:`bash pip installdjangoshop-gestpay`Add the following to your settings:`python INSTALLED_APPS += ['shop_gestpay'] SHOP_CART_MODIFIERS += ['shop_gestpay.modifiers.GestPayPaymentModifier'] SHOP_ORDER_WORKFLOWS += ['shop_gestpay.payment.GestPayWorkflowMixin'] SHOP_GESTPAY_SHOP_LOGIN = '<shopLogin>'  # GestPay shop login ID. `Additional settings with defaults:`python SHOP_GESTPAY_SERVER = 'ecomm.sella.it'  # Set to 'testecomm.sella.it' for testing. SHOP_GESTPAY_SEND_BUYER_NAME = False  # Send buyer name param to GestPay or not. SHOP_GESTPAY_SEND_BUYER_EMAIL = False  # Send buyer email param to GestPay or not. SHOP_GESTPAY_SEND_LANGUAGE = False  # Send language param to GestPay or not. SHOP_GESTPAY_PAYMENT_VIEW = False  # Set if a separate payment view should be rendered before sending to GestPay. SHOP_GESTPAY_CART_URL = SHOP_CART_URL ='shop:cart-list'# Url of a cart, used to redirect in some cases. SHOP_GESTPAY_THANK_YOU_URL = SHOP_THANK_YOU_URL = None  # Thank you url, if None latest order is used. SHOP_GESTPAY_COMMISION_PERCENTAGE = None  # Set to add commision percentage for purchase via GestPay. SHOP_GESTPAY_MODIFIER_CHOICE_TEXT = 'GestPay'  # Text displayed as a choice for selecting GestPay payment. SHOP_GESTPAY_ERROR_MESSAGE = None  # Message added to django messages framework there's a transaction error. SHOP_GESTPAY_SUCCESS_MESSAGE = None  # Message added to django messages framework transaction is successful. `[django-shop]:https://github.com/awesto/django-shop[gestpypay]:https://github.com/giefferre/gestpypay
Package: django-shopify-app
django-shopify-appAdd the app in settings.pyINSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'shopify_app',
        'shops',
    ]Add the required configurations in settings.pySHOPIFY_API_KEY = config('SHOPIFY_API_KEY')
    SHOPIFY_API_SECRET = config('SHOPIFY_API_SECRET')

    SHOPIFY_APP_SCOPES = [
        'read_products',
        'read_orders',
    ]
    SHOPIFY_WEBHOOK_TOPICS = [
        'products/update',
        'app/uninstalled',
    ]

    SHOPIFY_SHOP_MODEL = 'shops.Shop'

    SHOPIFY_WEBHOOK_HOST = 'https://moship.ngrok.io'
    SHOPIFY_APP_HOST = 'https://moship.ngrok.io'

    SHOPIFY_WEBHOOK_CALLBACK = 'shops.webhooks.webhook_entry'
    SHOPIFY_GDPR_WEBHOOK_CALLBACK = 'shops.webhooks.webhook_entry'Create a path to init the access token request and another path to end the token requestfrom django.urls import path

    from shopify_app.views import InitTokenRequestView, EndTokenRequestView

    app_name = 'my_shopify_app'


    urlpatterns = [
        path(
            'login-online/',
            InitTokenRequestView.as_view(
                redirect_path_name='my_shopify_app:end-token-request',
            ),
        ),
        path(
            'confirm/',
            EndTokenRequestView.as_view(
                redirect_path_name='embed_admin:dashboard',
            ),
            name='end-token-request'
        ),
    ]Add the url patterns for the appfrom django.contrib import admin
    from django.urls import path, include

    urlpatterns = [
        path('admin/', admin.site.urls),
        path('shopify/', include('shopify_app.urls')),
    ]