Saravanan666/pypi-org huggingface dataset:
Package: django-pagseguro
Aplicação para facilitar integração do django com pagseguro.Configurando a app django-pagseguroAdicione a app no INSTALLED_APPS no settings.pyINSTALLED_APPS = (
    ...
    'django_pagseguro',
    ...
)Configure no settings.py as constantes necessárias para utilizar a app.PAGSEGURO_EMAIL_COBRANCA = 'seu@email.com' # email de cobrança usado no pagseguro
PAGSEGURO_TOKEN = '1a3ea7wq2e7eq8e1e223add23ad23' # token gerado no sistema de url de retorno do pagseguro
PAGSEGURO_URL_RETORNO = '/pagseguro/retorno/' # url para receber o POST de retorno do pagseguro
PAGSEGURO_URL_FINAL = '/obrigado/' # url final para redirecionamento
PAGSEGURO_ERRO_LOG  = '/tmp/pagseguro_erro.log' # arquivo para salvar os erros de validação de retorno com o pagseguro(opcional)Configure a rota para url de retorno do PagSeguro no urls.pyfrom django_pagseguro.urls import pagseguro_urlpatterns
...
urlpatterns += pagseguro_urlpatterns()Criando o CarrinhoImporte o Carrinho do PagSegurofrom django_pagseguro.pagseguro import ItemPagSeguro, CarrinhoPagSeguroConfigure o carrinho do PagSeguro de acordo com seu projeto, no exemplo abaixo compra de Créditocarrinho = CarrinhoPagSeguro(ref_transacao=1)
carrinho.set_cliente(email='email@cliente.com', cep='60000000')
carrinho.add_item(ItemPagSeguro(cod=1, descr='Crédito', quant=1, valor=35.53))
form_pagseguro = carrinho.form()    # Form do pagseguro para usar no template de acordo com as configuraçõesCapturando sinais do retornoO django-pagseguro foi feito para que o desenvolvedor decida como vai tratar o retorno do PagSeguro,
portanto os dados enviados pelo PagSeguro não são alterados, eles são encaminhados através de um signal do django.Existem duas opções para capturar o retorno, de forma global ou específica para cada estado do pagamento.Signal Global:pagamento_atualizado: dispara em qualquer atualização do pagamentoSignals específicos para cada status do pagamento:pagamento_aprovado: Aprovadopagamento_cancelado: Canceladopagamento_aguardando: Aguardando Pagamentopagamento_em_analise: Em Análisepagamento_completo: Completopagamento_devolvido: DevolvidoCapturando o sinal e processando os dados de retorno do PagSegurofrom django_pagseguro.signals import pagamento_aprovado
...
def liberar_pedido(sender, **kwargs):
    ref = sender.referencia
    tipo_pagamento = sender.dados['TipoPagamento'] # exemplo de como pegar informações enviada pelo PagSeguro
    # aqui você deve executar seu código para liberar o pedido para a Referência
...
pagamento_aprovado.connect(liberar_pedido)Configurando logsCaso queira configurar os logs, você deve fazer conforme adocumentação do Django sobre a configuração de logs, por exemplo:LOGGING = {
    ...
    'loggers': {
        'django_pagseguro': {
            'handlers': ['console'],
            'level': 'INFO',
        }
    }
    ...
}AutorFábio CerqueiraColaboradoresMário ChavesBruno GolaCaio AriedeAllisson AzevedoFernando SouzaReferênciasProjetos que inspiraram esse:https://github.com/pagseguro/pythonhttps://github.com/fnando/pagseguroDocumentação do PagSeguro:Carrinho próprioRetorno automático de dados
Package: django-pagseguro-v1-p3
Aplicação para facilitar integração do django com pagseguro.Versão do Python: 3.5Para versão 2 da API do PagSeguro use:django-pagseguro2Configurando a app django-pagseguroAdicione a app no INSTALLED_APPS no settings.pyINSTALLED_APPS = (
    ...
    'django_pagseguro',
    ...
)Configure no settings.py as constantes necessárias para utilizar a app.PAGSEGURO_EMAIL_COBRANCA = 'seu@email.com' # email de cobrança usado no pagseguro
PAGSEGURO_TOKEN = '1a3ea7wq2e7eq8e1e223add23ad23' # token gerado no sistema de url de retorno do pagseguro
PAGSEGURO_URL_RETORNO = '/pagseguro/retorno/' # url para receber o POST de retorno do pagseguro
PAGSEGURO_URL_FINAL = '/obrigado/' # url final para redirecionamento
PAGSEGURO_ERRO_LOG  = '/tmp/pagseguro_erro.log' # arquivo para salvar os erros de validação de retorno com o pagseguro(opcional)Configure a rota para url de retorno do PagSeguro no urls.pyfrom django_pagseguro.urls import pagseguro_urlpatterns
...
urlpatterns += pagseguro_urlpatterns()Criando o CarrinhoImporte o Carrinho do PagSegurofrom django_pagseguro.pagseguro import ItemPagSeguro, CarrinhoPagSeguroConfigure o carrinho do PagSeguro de acordo com seu projeto, no exemplo abaixo compra de Créditocarrinho = CarrinhoPagSeguro(ref_transacao=1)
carrinho.set_cliente(email='email@cliente.com', cep='60000000')
carrinho.add_item(ItemPagSeguro(cod=1, descr='Crédito', quant=1, valor=35.53))
form_pagseguro = carrinho.form()    # Form do pagseguro para usar no template de acordo com as configuraçõesCapturando sinais do retornoO django-pagseguro foi feito para que o desenvolvedor decida como vai tratar o retorno do PagSeguro,
portanto os dados enviados pelo PagSeguro não são alterados, eles são encaminhados através de um signal do django.Existem duas opções para capturar o retorno, de forma global ou específica para cada estado do pagamento.Signal Global:pagamento_atualizado: dispara em qualquer atualização do pagamentoSignals específicos para cada status do pagamento:pagamento_aprovado: Aprovadopagamento_cancelado: Canceladopagamento_aguardando: Aguardando Pagamentopagamento_em_analise: Em Análisepagamento_completo: Completopagamento_devolvido: DevolvidoCapturando o sinal e processando os dados de retorno do PagSegurofrom django_pagseguro.signals import pagamento_aprovado
...
def liberar_pedido(sender, **kwargs):
    ref = sender.referencia
    tipo_pagamento = sender.dados['TipoPagamento'] # exemplo de como pegar informações enviada pelo PagSeguro
    # aqui você deve executar seu código para liberar o pedido para a Referência
...
pagamento_aprovado.connect(liberar_pedido)Configurando logsCaso queira configurar os logs, você deve fazer conforme adocumentação do Django sobre a configuração de logs, por exemplo:LOGGING = {
    ...
    'loggers': {
        'django_pagseguro': {
            'handlers': ['console'],
            'level': 'INFO',
        }
    }
    ...
}ReferênciasProjetos que inspiraram esse:PagseguroDocumentação do PagSeguro:Carrinho próprioRetorno automático de dados
Package: django-painless-redirects
django painless redirectslike django.contrib.redirects, on steroids. maybe.Featuressimple redirects table, with that bit more flexibility / conveniencedjango sites framework supportwildcard matchingexplicit limit to site/domainexplicit redirect to sitedecide if you want to keep GET varsmove complete trees (/old/productXY to /new/productXY, with one redirect, for all products)force site domain middleware, that redirects to current site's domain, if not already thereYet to be done:decide if to include GET vars when matching a redirectcontrib packages with "magic" redirects for django-cms, django-filer -> SEO getting easy.InstallationTo get the latest stable release from PyPipip install django-painless-redirectsAddpainless_redirectsto yourINSTALLED_APPSINSTALLED_APPS = (
    ...,
    'painless_redirects',
)Add the following middlware to MIDDLEWARE, to make basic manual redirects work.painless_redirects.middleware.ManualRedirectMiddlewareAs a rule of thumb, you'll add the middleware rather at the end of the list. If
you add it more at the beginning, other redirecting middlewares will
get priority - for example, you'll not be able to redirect any path
without having a language slug first, when LocaleMiddleware is before
our middleware.If you want to always redirect to the domain name entered in your current site (django.contrib.sites must be installed),
also add this middleware (position is not that important):painless_redirects.middleware.ForceSiteDomainRedirectMiddlewareCompatibilitydjango 1.11: should usedjango-painless-redirects<0.3.6(not supported anyway since april 2020)UsageAdd and manage your redirects in the django admin panel, under "painless redirects" > "redirects". Check hits,
check auto created redirects, enable them if needed.SettingsPAINLESS_REDIRECTS_INDEXED_CHARFIELD_MAX_LENGTH (default: 800)- needed for mysql (set to ~255). forces you to add'painless_redirects'tosettings.MIGRATION_MODULESPAINLESS_REDIRECTS_AUTO_CREATE (default: True)- auto create redirects when a 404 is encounteredPAINLESS_REDIRECTS_AUTO_CREATE_ENABLED (default: False)- should auto created redirects be enabled instantly? beware, enabling this feature might ruin your SEO, but could also be a real timesaver...PAINLESS_REDIRECTS_AUTO_CREATE_TO_PATH (default: '/')- where to redirect to, when a 404 is auto createdPAINLESS_REDIRECTS_AUTO_CREATE_SITE (default: True)- limit auto created redirects to the current site (from the django sites framework)Developmentthere is test app, available with./manage.py runserver.quick tests, within your current env: ./manage.py testto run tests with django 1.11 / 2.0 / 2.1 / ... :toxContributionsIf you want to contribute to this project, please perform the following steps.. code-block:: bash# Fork this repository
# Clone your fork
mkvirtualenv django-painless-redirects
pip install -r test_requirements.txt
git checkout -b feature_branch
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch
Package: django-painless-seo
# Django PainlessSEO[![Code Climate](https://codeclimate.com/github/Glamping-Hub/django-painless-seo/badges/gpa.svg)](https://codeclimate.com/github/Glamping-Hub/django-painless-seo)A painless way to add SEO information to your Django site.## FeaturesThis app provides two ways of adding SEO metadata to your django site:- Absolute paths- Model instancesIt's fully integrated with the admin site including inline forms for models.It also includes support for multiple languages and localized URLs, and havingseveral sites.## RequirementsDjango >= 1.5.0## InstallationThe Git repository can be cloned with this command:git clone https://github.com/Glamping-Hub/django-painless-seo.gitThe `painlessseo` package included in the distribution should be placed on the`PYTHONPATH`. Add `painlessseo` to the `INSTALLED_APPS` in your *settings.py*.Run `syncdb` command to create the needed tables.## SettingsPainlessSEO uses two configuration variables in order to define the defaultinformation that will be displayed if the URL has no SEO metadata related. Youhave to add them to your *settings.py*:SEO_DEFAULT_TITLE = 'Lorem ipsum title'SEO_DEFAULT_DESCRIPTION = 'Lorem ipsum description'### Registering ModelsTo create synced SEO metadata for model instances you have to define the`SEO_MODELS` variable in your *settings.py* like this:SEO_MODELS = (('myapp', 'mymodel'),('anotherapp', 'anothermodel'),)After registering the models, you can add the inline form to the admin instancefor each model:from painlessseo.admin import SeoMetadataInlineclass MyModelAdmin(admin.ModelAdmin):inlines = [SeoMetadataInline, ]Now every time you save a model instance through the admin site, the SEOmetadata will be updated automatically.## SEO OutputAs simple as loading the `seo` template library and using the `get_seo`template tag like this:{% load seo %}<head>{% get_seo %}</head>## Notes[Why PainlessSEO does not include keywords meta tag](http://googlewebmastercentral.blogspot.in/2009/09/google-does-not-use-keywords-meta-tag.html).## Legal StuffThis software is licensed under the terms of the BSD 3-clause license. You canfind the whole text of the license in the LICENSE file.
Package: django-paintstore
django-paintstoreis a Django app that integratesjQuery ColorPickerwith the Django adminQuickstartInstall the app with your preferred Python packaging utility, for example:pip install django-paintstoreAdd the application to theINSTALLED_APPSin settings.py:INSTALLED_APPS = (
    # ...
    'paintstore',
)Add a ColorPickerField to your model:# ...
from paintstore.fields import ColorPickerField

class ColorfulModel(models.Model):
    title = models.CharField(max_length=25)
    color = ColorPickerField()Optional: Edit colors directly in your model’s change list admin:class ColorfulModelAdmin(admin.ModelAdmin):
    list_display = ["title", "color",]
    list_editable = ["color",]TODOSReplace text input showing color hex code with a swatch of the color selectedDocs (prep to add to Read the Docs)Tests
Package: django-paloma
Inspired by Django’s recent push towards using class based views to increase code reusability, Paloma provides a similar interface to working with e-mails.InstallationTo install Paloma, do yourself a favor and don’t use anything other thanpip:$pipinstalldjango-palomaOnce installed, you also need to add Paloma to your list ofINSTALLED_APPSin your application configuration:INSTALLED_APPS=(...'paloma',)
Package: django-pam
A Django PAM authentication backend implementation.The MIT License (MIT)OverviewThis is a simple authentication backend that uses thepython-pampackage. Django PAM can be used in an SSO (Single Sign On) environment
or just with a single box where you want to log into a Django app with
your UNIX login.Updated for Django 4.2.x and Python 3.11.Python 2.x has been depricated. If you need a version of Django PAM use
version 2.0.1.ProvidesPAM Authentication BackendLogin and Logout ViewsTemplates for both standard and modal authentication.Supporting JavaScript and CSS.Quick StartYou will need to add Django PAM to yourINSTALLED_APPS:INSTALLED_APPS = [
    ...
    'django_pam',
]Next you will need to add the Django PAM backend to theAUTHENTICATION_BACKENDS:AUTHENTICATION_BACKENDS = [
    'django_pam.auth.backends.PAMBackend',
    'django.contrib.auth.backends.ModelBackend',
]The user that runs the application needs to be a member of the/etc/shadowfile group, this is usually the web server user. This
is necessary so the web server can authenticate other users. To do
this run the command below with the proper user:$ sudo usermod -a -G shadow <user>Complete Documentation can be found onRead the Docsat:Django PAM
Package: django-pandora
django-pandoraThis is Pandora’s box. Don’t open it if you cannot live with the
consequences.django-pandorais a utility library for django that lets you easily store
values in a thread-local. This makes it possible to introduce global variables
that are thread safe and don’t interfere with other requests to the server.However a global state is a common anti-pattern in software development that
you usually want to avoid. But at the end of the day it might be the easiest
way to solve some of your problems.The most common use case fordjango-pandoramight be to store the current
request in Pandora’s box to make it available in places of your code that
doesn’t get the request passed in as argument.Installationpip installdjango-pandoraAdd'pandora.middleware.RequestMiddleware'to yourMIDDLEWARE_CLASSESsetting. (optional)UsageThepandora.boxobject implements a dict like interface which you can use
to store thread local values. It’s really as simple as using a dictionary:>>> from pandora import box
>>> box['foo'] = 'Hello world!'
>>> box['foo']
'Hello world!'
>>> 'foo' in box
True
>>> 'bar' in box
False
>>> box['bar']
Traceback (most recent call last):
  ...
KeyError: 'bar'
>>> box.get('bar', None)
NoneAs mentioned above, you might want to use the box to store the current request
object. Pandora ships with a custom middleware for this purpose. Just append'pandora.middleware.RequestMiddleware'to yourMIDDLEWARE_CLASSESsetting. You can then access the request withbox['request'].There is also another middleware that stores the current user object inbox['user']. To use this, add'pandora.middleware.UserMiddleware'to
yourMIDDLEWARE_CLASSESsetting, but make sure that it is listedafter'django.contrib.auth.middleware.AuthenticationMiddleware'.TipsYou don’t need to import the box object into your module if you think the name
is too generic and might clash with some of your local names. Just use>>> import pandora
>>> pandora.box['request']
...Even if opening Pandora’s box might not seem too evil at the first glance,
please try to avoid it and pass the request object or any other dependency
around where possible. Having a global state makes things more difficult for
everyone - especially to reliably test your code.Read theWikipedia article about Pandora’s box.Changlog0.1.0Initial release.
Package: django-paperlayer
PaperlayerPaperlayer is a platform that enables academics to come together in their new projects using Dajngo app.Detailed documentation is in the github directory. (https://github.com/bounswe/bounswe2020group3/wiki)Quick startAdd "paperlayer" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'paperlayer',
]Include the polls URLconf in your project urls.py like this::path('', include('paperlayer.backend.urls')),Runpython manage.py migrateto create the paperlayer models.Runpython manage.py createsuperuserto create new admin user.Start the development server and visithttp://127.0.0.1:8000/swagger/to see all APIs.
Package: django-paps-quotes
django-paps-quotes/README.rst=======
django-paps-quotesdjango-paps-deliveries is a simple Django app to to manage all delivery prices urls from paps.
Detailed documentation is in the "docs" directory.Quick startAdd "quotes" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'quotes',
]Include the quotes URLconf in your project urls.py like this::path('quotes/', include('quotes.urls')),Run**python manage.py migrate**to create the quotes models.Visithttp://127.0.0.1:8000/quotes/to see all authentication urls.
Package: django-paraer
paraerPython Boilerplate contains all the boilerplate you need to create a Python package.Free software: MIT licenseDocumentation:https://paraer.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-05-07)First release on PyPI.
Package: django-parakeet
=====Django-Parakeet=====DJparakeet is a simple chat application for django built on top of django-channels and django-tastypie.1. Add djparakeet to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'djparakeet',]2. Include the djparakeet URLconf in your project urls.py like this::url(r'^parakeet/', include('djparakeet.urls')),3. Run `python manage.py migrate` to create the djparakeet models.4. Run 	runserver (or read django-channel documentation how to use in production)5. Add privileges to users to edit/create/delete Topic and Message in djparakeet app (using django-admin users admin, for example)6. Visit http://127.0.0.1:8000/parakeet/ to see the chat.
Package: django-param
Django ParamDjango Param provides the ParamForm class which translates a param class into a native Django Form.Quick startAdd 'colorfield', 'django_select2', 'django_param' and 'django.forms' to your INSTALLED_APPS setting like this:```python
INSTALLED_APPS = [
    ...
    'colorfield',
    'django_select2',
    'django_param',
]
```Usage# Specify your param classclassMyParam(param.Parameterized):probability=param.Number(0.5,bounds=(0,1),doc="Probability that...")test_string=param.String(default="test string",doc="Your String")my_param=MyParam()# Initialize Django Formform=ParamForm({'probability':0.1,'test_string':'test_bound'},param=my_param)# Get data from request.POSTform=ParamForm(request.POST,param=my_param)# To return param with values from request.POSTparam=form.as_param()Use form in template like a normal Django form:First you need to add the form media, you can include{{ form.media }}in the head element of your page.To add the form, simply use{{ form }}Supported param.ParametersBooleanColorCalendarDateDataFrameDateFileSelectorListSelectorMagnitudeMultiFileSelectorNumericTupleObjectSelectorRangeSelectorStringTupleXYCoordinatesCustom WidgetsYou can also override any default widget with your own custom widgets. For example:widget_map={param.String:lambdaparameterized_object,parameter,name:forms.CharField(initial=parameterized_object.inspect_value(name)orparameter.default,widget=Textarea,),}form=ParamForm(param=my_param,widget_map=widget_map)
Package: django-params-validator
django-params-validatordjango restframe params validatoruse for check django rest api params
用于检查django的rest接口的参数
包括参数的类型、范围
如果参数是bool类型，能将 1, 0转化为布尔值pipinstalldjango-params-validatorExamplefromdjango_params_validatorimportParams@Params(book_num=int,book_num__gte=100,book_num__lte=200,book__optional=False)defsome_interface(request,*args,**kwargs):pass@Params(name=str,name__default='jack',create_datetime=Params.DATETIME_STR,create_datetime__format='%Y-%m-%d',colors=('red','blue','yellow'),colors__many=True)defother_interface(request,*args,**kwargs):colors=kwargs.get('colors')# colors = ['']passOptionsTYPEname=str指定参数的类型其中Params.DATETIME_STR是特殊的时间戳字符串格式gt/lt/gte/lte制定参数的范围num__gte=100optional是否是可选参数default默认值manycolors__many=True是否是列表。
Package: django-paranoid
django-paranoidthis library adds 'created_at', 'updated_at' and 'delete_at' fields like a rail apps in django, also added soft delete method.installpip install django-paranoidHow to start1.- Add to django-paranoid in the django apps:INSTALLED_APPS = [
    'django.contrib.admin',
  'django.contrib.auth',
        ...
  'django_paranoid'
  ...
]2.- Extends ParanoidModel in the model to use:from django_paranoid.models import ParanoidModel

class MyModel(ParanoidModel):
    field = models.CharField(max_length=20)3.- Add to django-admin:from django_paranoid.admin import ParanoidAdmin

class MyModelAdmin(ParanoidAdmin):
    pass
  ...
admin.site.register(MyModel, MyModelAdmin)Soft Deletem = MyModel.objects.last()
m.delete()This only applies soft delete, so the record will remain in the database, but it will not be visible for normal queries:m = MyModel.objects.last()
>>> m
>>>Now the record has a deleted_at field and if do you want show the delete record you could using 'objects_with_deleted':m = MyModel.objects_with_deleted.last()
>>> m
<MyModel: name>
>>> m.deleted_at
datetime.datetime(2019, 8, 10, 6, 16, 44, 633727, tzinfo=<UTC>)Restore Soft DeleteOn object which was soft deleted, follow steps above to restore objectm.restore()Hard DeleteIf do you want to delete record from DB, you only should using True param:m = MyModel.objects.last()
m.delete(True)
Package: django-paranoid-model
Read the docs:https://darknessrdg.github.io/django-paranoid-model/django-paranoid-modelDjango abstract model with paranoid behavior, therefore when an instance is deleted it is not really deleted from database, it's applied a mask on the filter so when filter, the result are the "undeleted" instances.Sometimes you might want to keep all datas saved on your database and when user wants do delete, it is just hidden form user.All documentation are in themkdocs/docsdirectory and online atHERE !!. If you're new here, we recomend you to checkout the documentation first :wink: .Quick startInstall Django Paranoid Model package from pippipinstalldjango-paranoid-modelAdd paranoid_model to your installed apps so you can use django admin with a paranoid behaviorINSTALLED_APPS=[...'paranoid_model']Good job ! You're now ready to use it.Run testspip install -e .[test]
  pytestor run Tox to test on multiple Django versionspip install tox
  tox