Saravanan666/pypi-org huggingface dataset:
Package: django-pardakht
What’s this?You can use this app to create payments in your django project via Iranian gateways. (Right now only Zarinpal and Saman are available but the rest are coming soon)How does it work?You ask the app for a new payment and it will give you a link on your own site that you can redirect users to it in order to have a payment.Installationpip installdjango-pardakhtAddpardakhtto yourINSTALLED_APPSpython manage.py migrateAddpardakhturls to your project’s urls.from pardakht import urls as pardakht_urls
urlpatterns = [
    ...

    url(r'^<SOME_URL>/', include(pardakht_urls)),

    ...
]For any gateway you use, add GATEWAY_MERCHANT_ID in your project settings. For example if you are going to use zarinpal, You need to addZARINPAL_MERCHANT_IDin your settings with value set to your zarinpal merchant ID or if you are using saman gateway, You need to addSAMAN_MERCHANT_IDin your settings.UsageThere is a payment model that app uses to handle payments. Every payment you create needs 5 initial parameters.price:  Price of the payment.description:  Short description about this payment. Necessary for some gateways such as Zarinpal.return_function:  A callable object (function) that will get called after payment is done with the payment object as it’s input. It’s optional and can be None.return_url:  A url for user to come back where he left off on your site. It’s optional and can be None.login_required:  Must be True if user who is paying should be authenticated. If you’re going to use this you have to set LOGIN_URL in project settings.To create a payment:from pardakht import handler
result = handler.create_payment(
    price,
    description,
    return_function,
    return_url,
    login_required
)This will create a payment and returns a dict containing payment object and a link to pay it:result['payment']   #  Created payment object
result['link']      #  Link for paying this payment that you should redirect your user toExtra notesThis app handles all steps of payment including UI parts.It uses semantic-ui so if you want to use it you need to serve app’s static files.But of course you can override templates to use your own templates with your own UI design.ConfigurationsIf you are using ZarinGate to send users directly to the bank payment page, setZARINPAL_USE_ZARINGATEtoTruein your project settings.
Package: django-parler-rest
django-parler-restAdding translation support todjango-rest-framework.This package adds support for TranslatableModels fromdjango-parlertodjango-rest-framework.Installationpipinstalldjango-parler-restUsageFirst make sure you have django-parler_ installed and configured.Use the serializers as demonstrated below to expose the translations.First configure a model, following thedjango-parler documentation:fromdjango.dbimportmodelsfromdjango.utils.translationimportgettext_lazyas_fromparler.modelsimportTranslatableModel,TranslatedFieldsclassCountry(TranslatableModel):"""Country database model."""country_code=models.CharField(_("Country code"),unique=True,db_index=True)translations=TranslatedFields(name=models.CharField(_("Name"),max_length=200)url=models.URLField(_("Webpage"),max_length=200,blank=True))classMeta:verbose_name=_("Country")verbose_name_plural=_("Countries")def__str__(self):returnself.nameThe model translations can be exposed as a separate serializer:fromrest_frameworkimportserializersfromparler_rest.serializersimportTranslatableModelSerializer,TranslatedFieldsFieldfrom.modelsimportCountry# Example modelclassCountrySerializer(TranslatableModelSerializer):translations=TranslatedFieldsField(shared_model=Country)classMeta:model=Countryfields=('id','country_code','translations')Note:TheTranslatedFieldsFieldcan only be used in a serializer that inherits fromTranslatableModelSerializer.This will expose the fields as a separate dictionary in the JSON output:{"id":528,"country_code":"NL","translations":{"nl":{"name":"Nederland","url":"http://nl.wikipedia.org/wiki/Nederland"},"en":{"name":"Netherlands","url":"http://en.wikipedia.org/wiki/Netherlands"},"de":{"name":"Niederlande","url":"http://de.wikipedia.org/wiki/Niederlande"}}}ContributingThis module is designed to be generic. In case there is anything you didn't like about it,
or think it's not flexible enough, please let us know. We'd love to improve it!If you have any other valuable contribution, suggestion or idea,
please let us know as well because we will look into it.
Pull requests are welcome too. :-)Running testsTests are run withpy.test:pythonsetup.pytest# install dependencies and run tests with coverage
Package: django-parler-tools
Parler Tools
extracts applicable methods from aldryn-translation-tools to be used without django-cmsmodels.TranslatedAutoSlugMixinThis is a TranslatableModel mixin that automatically generates a suitable
slug for the object onsave().Ifslug_globally_uniqueisTrue, then slugs will be required to be
unique across all languages.Ifslug_globally_uniqueisFalse(default), then the strategy used here
is that it is OK for two objects to use the same slug if the slugs are for
different languages. So if this were used on a translated Article model, these
URLs would be valid:/en/pain- An article in EN about physical discomfort/fr/pain- An article in FR about breadOf course, this means that when resolving an object from its URL, care must
be taken to factor in the language segment of the URL too.When using this mixin, it is important to also set theslug_source_field_nameproperty on the implementing model to the name of
the translated field which the slug is to be derived from. If you require more
slugs to be derived from multiple fields (translated or otherwise), simply
override the methodget_slug_sourceto provide the source string for the
slug.Configuration propertiesslug_defaultProvide a lazy translated string to use for the default slug should an object
not have a source string to derive a slug from.slug_field_nameProvide the name of the translated field in which generated slug shall
be stored.slug_globally_uniqueA boolean flag controlling whether slugs are globally unique, or only unique
with each language. Default value is False.slug_max_lengthDeclares the max_length of slugs. This defaults to themax_lengthof the
slug_field and is determined via introspection.slug_separatorThis determines the separator used before any index added to the slug. It doesnotdetermine the separator used in the slug itself, which is always-.
This is only provided for compatibility with the slugify()`` method in
aldryn_common, but it is not recommended to be used. Defaults to-.slug_source_field_nameProvide the name of the translated field to be used for deriving the slug.
If more than one field, or other complex sources are required, override the
methodget_slug_source()instead. Note that ifget_slug_source()is
overriden, it is recommended to also overrideget_slug_default().Public methodsget_slug_defaultNaively constructs a translated default slug from the object. For better
results, just set theslug_defaultproperty on the class to a lazy
translated string. Alternatively, override this method if you need to more
programmtically determine the default slug.Example: If your model is “news article” and your source field is “title” this
will return “news-article-without-title”.get_slug_max_lengthAccepts an optional parameteridx_len.Introspects the slug field to determine the maximum length, taking into account
a possible separator and up to a [idx_len]-digit number.get_slug_sourceSimply returns the value of the slug source field. Override for more complex
situations such as using multiple fields (translated or not) as the source.
Package: django-parse-push
# django-parse-push #A simple Django library for pushing notifications thru Parse.---**Comes out of the box with*** Django REST Framework endpoint for registering a device token thru REST* Basic tests## Installation ##1) Install thru PIPpip install django-parse-push2) Add `parse_push` to `settings.INSTALLED_APPS````pythonINSTALLED_APPS = (# ...,parse_push,)```3) Run migrationspython manage.py migrate parse_push4) Add environment vars```bashPARSE_APPLICATION_ID=your_parse_application_idPARSE_REST_API_KEY=your_parse_api_key# Optional environment varsPARSE_API_URL=https://api.parse.comPARSE_API_VERSION=1```5) Add REST endpoint to urls.py```pythonfrom django.conf.urls import patterns, include, urlurlpatterns = patterns('',# ...(r'^api/v1/parse-push', include('parse_push.urls')),# ...)```## Usage #####Example 1###*A simple Django based example*```pythonfrom django.contrib.auth import get_user_modelUser = get_user_model()user = User.objects.get(email='donald@duck.com')device = user.device_set.get_latest('created_at')device.push({'alert': 'Hello World!', 'text': 'Lorem ipsum dolor...'})```###Example 2###*With Django based User model*```pythonfrom django.contrib.auth.models import AbstractBaseUser, PermissionsMixinclass User(AbstractBaseUser, PermissionsMixin)# ...def get_full_name(self):""" Returns the full name """full_name = u"{} {}".format(self.first_name, self.last_name)return full_name.strip()def push(self, data):device = self.device_set.get_latest()return device.push(data)```###Example 3###*Barebone client, no dependency on Django*```pythonfrom parse_push.client import get_clientclient = get_client()client.push('ios', 'devicetokenabcdefghijklmnopqstruvwxyz0123456789', {'foo': 'bar'})```You can also configure a Client instance with `APPLICATION_ID` and `REST_API_KEY````pythonclient = Client(application_id='applicationidabcdefghijklmn0123456789', rest_api_key='restapikeyabcdefghijklmn0123456789')```
Package: django-parser
Djang0parserMultifunctional html sanitizer with code highlighting and django integrationInstallingIn settings set VALID_TAGS and VALID_ATTRS, like:>>> VALID_TAGS = 'a strong img cut'
>>> VALID_ATTRS = 'href src'Add djang0parser to INSTALLED_APPS and run syncdb.UsageFor text sanitizing use:>>> from djang0parser.utils import parse
>>> parse(text)or:>>> parse(text, 'a b i img', 'src style')For reverting changes use:>>> from djang0parser.utils import unparse
>>> unparse(parsed_text)For finding user mention use:>>> from djang0parser.utils import find_mentions
>>> find_mentions(text)For cut and full cut(fcut) use:>>> from djang0parser.utils import cut
>>> preview, text = cut(full_text)
Package: django-partial-content
Support for partial content in Django staticfiles.After an installation add the following app to your settings.INSTALLED_APPS=[...'django-partial-content',...]After that Django will respectRangeheader in requests to static files. Note that usingstaticfilesmodule in production is not recommended. The extension is only for ease of development.The lowest Django version I could get it work is 1.8. Also works on Python 2.7. Tested on Chrome-like browser and Firefox.Known issues:Multiple ranges aren’t supported.
Package: django-partial-date
django_partial_dateDjango custom model field for partial dates with the form YYYY, YYYY-MM, YYYY-MM-DDWorks with DRFSupports comparison operationsSupports Django versions 2.0, 3.0 and 4.0Usageinstall the packagepipinstalldjango_partial_datepartial_date.PartialDateFieldA django model field for storing partial dates. Accepts None, a partial_date.PartialDate object, or a formatted string such as YYYY, YYYY-MM, YYYY-MM-DD. In the database it saves the date in a column of type DateTimeField and uses the seconds to save the level of precision.class partial_date.PartialDateObject to represent the partial dates.Examplemodels.pyfromdjango.dbimportmodelsfrompartial_dateimportPartialDateFieldclassTestModel(models.Model):some_partial_date=PartialDateField()>>>frompartial_dateimportPartialDate>>>fromcore.modelsimportTestModel>>>obj=TestModel(some_partial_date="1995")>>>obj.save()>>>obj.some_partial_date'1995'>>>obj.some_partial_date=PartialDate("1995-09")>>>obj.save()>>>obj.some_partial_date1995-09>>>>>>frompartial_dateimportPartialDate>>>importdatetime>>>partial_date_instance=PartialDate(datetime.date(2012,9,21),precision=PartialDate.DAY)>>>partial_date_instance2012-09-21>>>partial_date_instance.precisionYear()False>>>partial_date_instance.precisionMonth()False>>>partial_date_instance.precisionDay()True>>>partial_date_instance.precision==PartialDate.YEARFalse>>>partial_date_instance.precision==PartialDate.MONTHFalse>>>partial_date_instance.precision==PartialDate.DAYTrue>>>partial_date_instance.precision=PartialDate.MONTH>>>partial_date_instance2012-09>>>partial_date_instance=PartialDate("2015-11-01")>>>partial_date_instance.datedatetime.date(2015,11,1)>>>frompartial_dateimportPartialDate>>>partial_date_instance=PartialDate("2015-11-01")>>>partial_date_instance2015-11-01>>>partial_date_instance.format('%Y','%m/%Y','%m/%d/%Y')# .format(precision_year, precision_month, precision_day)'11/01/2015'>>>partial_date_instance=PartialDate("2015-11")>>>partial_date_instance2015-11>>>partial_date_instance.format('%Y','%m/%Y','%m/%d/%Y')'11/2015'>>>partial_date_instance=PartialDate("2015")>>>partial_date_instance2015>>>partial_date_instance.format('%Y','%m/%Y','%m/%d/%Y')'2015'Thanks for their collaborations tolorinkozhowieweinerjghyllebertsorinmarti
Package: django-pascal-templates
Django generic views with PascalCase template paths with model named folders.https://github.com/wooyek/django-pascal-templatesUsageReplace your usual generic view imports with:frompascal_templates.viewsimportDetailView,CreateView,UpdateView,DeleteView,ListViewAnd in result get additional template_names allowing you to keep templates in folders named after your models:names=['some_app/somemodel_detail.html','some_app/SomeModel/detail.html',# This is what you get]In effect you can use a nice folder structure with templates that are easy to manage:templates├──SomeModel│├──detail.html│├──form.html│└──list.html├──SomeOtherModel│├──detail.html│├──form.html│└──list.html
Package: django-passaporte-web
Sobre o Passaporte WebO Passaporte Web é um ecossistema de aplicações corporativas que disponibiliza uma série de funcionalidades para
simplificar a implementação, operação e comercialização de suas aplicações; com o objetivo de possibilitar que você
se preocupe somente com o desenvolmento das funções diretamente relacionadas aos objetivos de sua aplicação.Nosso objetivo é construir uma comunidade de desenvolvedores e aplicações de altíssima qualidade.O Passaporte Web oferece:Mecanismos de cadastro de usuários, autenticação e controle de acesso centralizado;Ferramentas para gestão de usuários, vendas, pagamentos, aplicações e controle de acesso aos sistemas e às APIs;Sistema de venda de acesso às aplicações, com suporte a múltiplos meios de pagamento e cobrança recorrente;Mecanismos para simplificar a integração entre aplicações do ecossistema;Ambientes de homologação (sandbox) para auxiliar o desenvolvimento e evolução de sua aplicação;Configurações necessáriasINSTALLED_APPS+=('identity_client',)TEMPLATE_CONTEXT_PROCESSORS+=('identity_client.processors.hosts',)MIDDLEWARE_CLASSES+=('identity_client.middleware.P3PHeaderMiddleware',)APPLICATION_HOST='<protocol>://<host>'PERSISTENCE_STRATEGY='django_db'ou'mongoengine_db'AUTHENTICATION_BACKENDS=('identity_client.backend.MyfcidAPIBackend',)SERVICE_ACCOUNT_MODULE='identity_client.ServiceAccount'PASSAPORTE_WEB={'HOST':'http://sandbox.app.passaporteweb.com.br','SLUG':<slugdasuaaplicação>,'CONSUMER_TOKEN':<tokendeumainstânciadasuaaplicação>,'CONSUMER_SECRET':<secretdeumainstânciadasuaaplicação>,'AUTH_API':'accounts/api/auth/','REGISTRATION_API':'accounts/api/create/','PROFILE_API':'profile/api/info/','REQUEST_TOKEN_PATH':'sso/initiate/','AUTHORIZATION_PATH':'sso/authorize/','ACCESS_TOKEN_PATH':'sso/token/','FETCH_USER_DATA_PATH':'sso/fetchuserdata/',}ifPERSISTENCE_STRATEGY=='mongoengine_db':SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer'# django >= 1.6NOSQL_DATABASES={'NAME':'<db name>','HOST':'<db host>',}
Package: django-passbook
![Passbook](http://cl.ly/JPjc/title_passbook.png)===============django-passbook===============This application implements the specified API for passbook webservices. It handles pass registration, updates and logging. It may be easily plugged to you django application by just adding the installed app and importing the urls. It is based on Apple's specificatin and Mattt's rails example (https://github.com/mattt/passbook_rails_example)> If you need to create passes (.pkpass files) in python you should check http.//github.com/devartis/passbook.Requirements============- Django 1.4Getting Started===============```$ pip install django-passbook```Add 'django_passbook' to you installed apps in the settings.py file.You should also import the urls in your site urls.```from django_passbook import urlsurlpatterns = patterns('',url(r'^api/', include('django_passbook.urls')),```django-passbook signals certain events that might come handy in your application.```from django_passbook.views import pass_registered, pass_unregistered@receiver(pass_registered)def pass_registered(sender, **kwargs):pass@receiver(pass_unregistered)def pass_unregistered(sender, **kwargs):pass```Specification=============The complete specification can be found in the [Passbook Web Service Reference](https://developer.apple.com/library/prerelease/ios/#documentation/PassKit/Reference/PassKit_WebService/WebService.html).Contact=======devartis- http://devartis.com- http://github.com/devartis- http://twitter.com/devartis- info@devartis.com
Package: django-pass-code
=====
django-pass-codeПриложение для авторизации через смс, при помощи сервиса smsc.ruБыстрый запускДобавьте "account" в файле settings.py в INSTALLED_APPS::INSTALLED_APPS = [
...
'account',
]Подключите путь account::path('account/', include('account.urls')),Выполнитеpython manage.py migrateдля миграций.
Package: django-pass-strength-validator
django-pass-strength-validatordjango-pass-strength-validatoris a password strength validator for Django based on thezxcvbnlibrary developed by Dropbox. Any time a user attempts to set a password with a strength less than the specified level, a ValidationError will be raised. This enhances the security of your app by ensuring users have strong passwords.Through pattern matching and estimation, the zxcvbn library recognizes and weighs 30k common passwords, common names and surnames according to US census data, popular English words from Wikipedia and US television and movies, and other common patterns like dates, repeats (aaa), sequences (abcd), keyboard patterns (qwertyuiop), and l33t speak.Installationpipinstalldjango-pass-strength-validatorUsage in DjangoAdd a string reference to the PasswordStrengthValidator class from thedjango-pass-strength-validatorlibrary in theAUTH_PASSWORD_VALIDATORSlist in your Django project settings.Thezxcvbnlibrary returns a password strength score from 0 to 4, with 0 being the weakest and 4 being the strongest password strength. The default minimum password strength level for thedjango-pass-strength-validatorlibrary is 3. This means if a user attempts to save a password that has a strength less than 3, a ValidationError will be raised. You can change the minimum password strength level by passing though an OPTIONS value in Django settings, as shown in the example below.AUTH_PASSWORD_VALIDATORS=[# There will likely be other validators included by default{'NAME':'django_pass_strength_validator.PasswordStrengthValidator','OPTIONS':{'min_strength':3,# Optional, can be an integer from 0 to 4}},]
Package: django-password-expire
Django password expiration appThis app provides configurable expiration of passwords.FeaturesConfigurable password duration and warning durationVisual warning to user using Django messagesPrevents user from logging in after expirationRequirementsThis Django app requires Python >= 3.6 and has been tested with Django 2.2, 3.1, and 3.2.Installationpip install django-password-expire.Addpassword_expiretoINSTALLED_APPS.Add'password_expire.middleware.PasswordExpireMiddleware'toMIDDLEWARE.
It should be listed after authentication and session middlewares.Configure the app in your settings:# contact information if password is expiredPASSWORD_EXPIRE_CONTACT="John Doe <jdoe@example.com>"# expire passwords after 90 daysPASSWORD_EXPIRE_SECONDS=90*24*60*60# start warning 10 days before expirationPASSWORD_EXPIRE_WARN_SECONDS=10*24*60*60Runpython manage.py migrateto create the required database tables.To redirect new users to the change password page, set this flag in the settings:PASSWORD_EXPIRE_FORCE=TrueIf you want to exclude superusers from the password expiration, set this flag:PASSWORD_EXPIRE_EXCLUDE_SUPERUSERS=TrueAcknowledgementsThis app is inspired bydjango-password-policies-iplweb.
Package: django-password-history
Django Password HistoryDjango module meant to allow django users to keep a history of their previously used passwords.📝 Table of ContentsAboutGetting StartedRunning TestsUsageBuilt UsingAuthorsAcknowledgmentsAboutDjango module meant to allow django users to keep a history of their previously used passwords.Getting StartedFollow these instructions to install and setup django-password-history in your django project.PrerequisitesThe only prerequisites to installing django-password-history is having django 2 installed in a Python 3 environment.InstallingThe installation process for django password history is very simple. Start by running the following command to install the package.pip install django-password-historyEnd with an example of getting some data out of the system or using it for a little demo.Running TestsThe test suite for this package is a work in progress. The initial sample test can be run by using the following command.coverage run --source django_password_history runtests.pyUsageIn order to use the system you must add django_password_history to your installed apps in your settings.py file.INSTALLED_APPS = [
    'django_password_history'
]Next you need to define how many historical passwords you want to compare on to the new password when a password is chanced. The default and max is 5 previous passwords.PREVIOUS_PASSWORD_COUNT = 3THe UserPasswordHistory has a one to one relationship with your user model as defined in your settings.py file.AUTH_USER_MODEL = "users.User"To import the UserPasswordHistory model add the following to the top of the desired python file.from django_password_history.models import UserPasswordHistoryBuilt UsingDjango- Web FrameworkCookiecutter Django Package- Cookie Cutter Django PackageAuthorsDavid Graves - Working on behalf of Lender's CooperativeRoderick Smith- Working on behalf of Lender's CooperativeAcknowledgementsInspirationReferencesHistory1.0.0 (2021-06-21)
++++++++++++++++++First release on PyPI.1.0.3 (2021-12-08)
++++++++++++++++++Accommodate tenant architecture by checking for a SiteSettings model to see if previous_password_count has been set.Second release on PyPI.1.0.4 (2022-02-08)
++++++++++++++++++Set django admin user fields to autocomplete, and change password fields to read only.Third release on PyPI.1.0.5 (2022-08-31)
++++++++++++++++++Extend support of password history up to 24 passwords.Fourth release on PyPI.
Package: django-password-history-plus
django-custom-accounts-plusThis package stores password histories and checks new password with the historyQuick start1. Add “password_histories” to your INSTALLED_APPS setting like this::
``
INSTALLED_APPS = [
…
‘password_histories’,
]
``2. Migrate
``
python manage.py migrate
``TODOChangelog1.0.0 - 2023-02-26 Arindam Dutta - First release
1.0.1 - 2023-02-26 Arindam Dutta - Documentation UpdateCopyright(c) 2023 Arindam Dutta
Package: django-passwordless-auth
Installation$[sudo]pipinstalldjango-passwordless-authPros3rd party/social authentication without passwordExamplessettings.py# from django_passwordless_auth.settings import AUTHENTICATION_BACKENDSAUTHENTICATION_BACKENDS=('django_passwordless_auth.backend.PasswordlessAuthBackend',)views.pyfromdjango.contrib.authimportlogindefview(request):...login(request,user,backend='django_passwordless_auth.backend.PasswordlessAuthBackend')readme42.com