Saravanan666/pypi-org huggingface dataset:
Package: django-o2o_tagging
Welcome to the documentation for django-o2o_tagging! Use this app to
tag objects like you tag your friends on facebook, but using any
objects as the tagger, the tagged and the tagged in. Think of aUsertagging aFriendin aPhotoall of them being different models.Quick startInstall using pip:pip install django-o2o_taggingAdd o2o_tagging to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'o2o_tagging',
)UsageModelsTag your objects:...
tag = O2OTag.objects.tag(tagger, tagged, tagged_in)Get for tagged in objects:...
tags = O2OTag.objects.for_tagged_in(tagged_in)Get for tagger objects:...
tags = O2OTag.objects.for_tagger(tagger)Get for tagged objects:...
tags = O2OTag.objects.for_tagged(tagged)You can then filter:...
tags.for_tagger(tagger).for_tagged(tagged)URLsYou can add this views to your urls:...
('^tagging/$', include('o2o_tagging')),Viewso2o_taggin provides two views:TagCreateView

TagsCreateViewTemplatesThere are two templatetags availablefor_tagged_in:{% for_tagged_in object as tags %}for_tagged_in_nodups:{% for_tagged_in_nodups object as tags %}Apply distinct ontagged_object_idin order to get only one
tagged user.Running the TestsYou can run the tests with via:python setup.py test
Package: django-o365mail
django-o365mailAboutSMTP authenthication is getting increasingly difficult, mainly because of security.This Django email backend has been created to solve that problem when using Office 365. It's easy to use and quite customizable.InstallationRun the following on your system:pip install django-o365mailThen, add these settings to your Django settings.py:EMAIL_BACKEND = 'django_o365mail.EmailBackend'

O365_MAIL_CLIENT_ID = 'REPLACE THIS'
O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'
O365_MAIL_TENANT_ID = 'REPLACE THIS'If you're using git, make sure to add the following to.gitignore:o365_token.txtMail can then be sent using the Django mail functions, as describedhere.Optional settingsMailboxThis module uses thepython-o365library, which is also slightly customizable. Because of this you can define kwargs to be used when opening the mailbox. As an example:O365_MAIL_ACCOUNT_KWARGS = {'token_backend': 'O365.utils.token.EnvTokenBackend'}
O365_MAIL_MAILBOX_KWARGS = {'resource': 'o365mailbox@domain.com'}... which will be passed to the mailbox() function like this:account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=self.tenant_id, **account_kwargs)
mailbox = account.mailbox(**O365_MAIL_MAILBOX_KWARGS)OtherO365_MAIL_REPLACE_LINE_ENDINGS(default:True)Replaces line endings with an HTML line break (<br />) when emails are sent in plain text.O365_MAIL_SAVE_TO_SENT(default:False)Saves sent emails to the 'Sent' folder.O365_SUBJECT_PREFIX(default:'')Prefix for the subject of any email sent using this backend.O365_ACTUALLY_SEND_IN_DEBUG(defaullt:False)The default valueprevents sending when DEBUG=True. You most likely want to set this toTruefor development purposes.SandboxCreate a file calledsettings_secret.pyunder thesandbox/sandboxdirectory (same directory assettings.py) with the settings as described above, except for theEMAIL_BACKEND. It could look like this:O365_MAIL_CLIENT_ID = 'REPLACE THIS'
O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'
O365_MAIL_TENANT_ID = 'REPLACE THIS'Then, if needed, add settings tosettings.py.To be able to make changes to this module, run the following command to install this module in editable mode:pip install -e ./And run the sandbox server:cd sandbox && python manage.py runserver
Package: django-oasis4-certs
Generador de Certificados OASIS4© para DjangoEste módulo permite la generación de los certificados tributarios, comerciales, de asociados, estados de cuenta y fincas
de los clientes y asociados que se encuentran matriculados en la base de datos OASIS4©.El módulo provee algunas apis para:Consultar certificados disponibles "/document/list/"Generar el certificado escogido "/document/generator/"Descargar un certificado específico "/document/get/"Solicitar el envío a través de correo electrónico de un certificado "/document/send/"Todos las API aqui relacionadas requieren para su operación estar auténticados y ser un asociado o cliente registrado en el portal y en el sistema.Versiones Liberadas1.0.0: Versión con la generación y compatibilidad necesarias para la generación de certificados standard.
Package: django-oauth-api
Django OAuth APIThis package provides OAuth API using Django Rest FrameworkInstallation$pipinstalldjango-oauth-apiRequirementsPython 3.8, 3.9 or 3.10Django3.2 or laterDjango Rest Framework3.14 or laterOAuthLib3.2.2LicenseSimplified BSD LicenseCreditsBig thank you for the people behindevonove/django-oauth-toolkit! This project is a fork/heavily based on the work done by them.Changes0.9.0 [2023-03-01]AddedSupport Django 4.1UpdatedPOSSIBLY BREAKING: Updated oauthlib to 3.2.2This causes certain operations to return HTTP 400 instead of 401, checkhttps://github.com/oauthlib/oauthlib/blob/master/CHANGELOG.rst#300-2019-01-01Updated DRF minimum version to 3.14.0 (earlier versions also should continue to work)Indexed RefreshToken modeltokenfieldChanged field type ofcodein AuthorizationCode andtokenin AccessToken and RefreshToken models to be TextField, removing the 255 character limitation0.8.3 [2022-04-04]AddedGitHub Actions integratedFixedMissing migration file added0.8.2 [2022-03-22]Updatesetup.pynow provides long descriptionFixedsetup.pycontained incorrect classifier0.8.1 [2022-03-22]Updatedsetup.pycleanup0.8.0 [2022-03-22]AddedAdded support for Python 3.10Added support for Django 3.2Added support for Django 4.0UpdatedDropped support for Python 3.7Dropped support for Django 3.1 and earlier versions0.7.0 [2020-01-30]Update: Added support for Python 3.7 and 3.8Update: Added support for Django 2.2 and 3.0Update: Dropped compatibility with Python 2.x, Django 1.11 and DRF <3.10Update: Removeddjangorestframework-xmldependency as redundant0.6.3 [2018-08-30]Handle request withNonebody value when verifying requests.Do not generate client ids with leading or trailing spaces asAuthorizationView/FormViewstrips them away and breaks the flow (and randomly tests too)Removed Django 1.10 supportAdded Django 2.1 supportFixed Django (master branch) support0.6.2 [2018-08-21]Specifyapp_nameinurls.pyto support namespacing in Django 20.6.1 [2018-06-06]Update: Allow overriding of API renderer and parser classes in the settingsUpdate: Modified initial migration file that contained South-era bytestrings in verbose names (only Django cares about them, not the DB)0.6.0 [2018-04-13]Update: Dropped support for Django <1.11Update: Added support for Python 3.6Update: Added support for Django 2.0Update: Updated to use oauthlib 2.0.7Update: Tidying of the codebase here and there0.5.3 [2016-09-22]Update: Updated to use oauthlib 1.1.20.5.2 [2016-04-05]Update: Application model is now swappable0.5.1 [2016-02-17]Update: Django 1.9 support added0.5.0 [2015-09-04]Feature: Token revocation support addedUpdate: Updated to use latest oauthlib 1.0.3Update: Do not assign user to Access Token if Client Credentials grant usedBug: Using public apps with client_id only did not work
Package: django-oauth-backend
Django OAuth Backendis a set ofDjangomodels which are required
for implementingOAuthprotocol on the server side. Those models can
be used together with various other projects which implement HTTP part
of the protocol. One such projects islazr.authentication.UsageUsage is quite simple.First thing is to add this application to Django’sINSTALLED_APPSlist:INSTALLED_APPS = (
    ...
    'oauth_backend'
)Next is to integrate it withOAuthprotocol provider, likelazr.authentication. It will look something like that:# Application's WSGI file
from django.core.handlers.wsgi import WSGIHandler
from lazr.authentication.wsgi import OAuthMiddleware
from oauth_backend.models import DataStore, Consumer, Token


def oauth_authenticate(oauth_consumer, oauth_token, parameters):
    try:
        consumer = Consumer.objects.get(
            user__username=oauth_consumer.key
        )
        token = Token.objects.get(token=oauth_token.key)
        if token.consumer.key == oauth_consumer.key:
            return consumer.user
    except (Token.DoesNotExist, Consumer.DoesNotExist):
        return None


django = WSGIHandler()
application = OAuthMiddleware(
    django,
    authenticate_with=oauth_authenticate,
    data_store=DataStore(),
    protect_path_pattern="/protected"
)NoteWhereoauth_authenticateis function which checks thatOAuthtoken is known. Additionally you can check that user
associated with this token is allowed to use it, or that
token itself is not expired. Because that part is highly
dependant on the mechanisms of application itself it’s not
provided out of the box.HistoryThis code was extracted fromCanonical Identity Providerproject. Although an extra effort was made to make sure that all
dependencies are broken and this code is fully independent, it’s
conceivable that some small things were missed. In that case please
report those bugs on theproject’s bug page.
Package: django-oauthost
http://github.com/idlesign/django-oauthostWhat’s thatReusable application for Django to protect your apps with OAuth 2.0.It allows to guard your application views with OAuth 2.0 in quite a trivial way.Register your client using Django Admin or API:fromoauthost.toolboximportregister_client...# Define some scopes to restrict our client to (if required).my_scopes=['polls:vote']# `user` might be `request.user` if in a view.register_client('My OAuth Client','my_client','http://someurl.com/myclient/',user,scopes_list=my_scopes)...Decorate your views withoauth_required(suppose inpolls.views):fromoauthost.decoratorsimportoauth_required@oauth_required(scope_auto=True)defvote(request,poll_id,variant_id):...Attachoauthost.urlsto projecturls(inurls.py):fromoauthost.urlsimporturlpatternsasoauthost_urlpatternsurlpatterns=...# Your actual urlpatterns are ommited.urlpatterns+=oauthost_urlpatternsNow authorization endpoint is available at{ BASE_URL }auth/and token endpoint is available at{ BASE_URL }token/.That’s all foroauthost, connect using your client.More information is available, read the docs!Documentationhttp://django-oauthost.readthedocs.org/
Package: django-oauth-tokens
# IntroductionApplication for getting, storing and refreshing OAuth access_tokens for Django standalone applications without user manipulations.
Applications also can imitate authorized requests on behalf of user# Providers## VkontakteOAUTH_TOKENS_VKONTAKTE_CLIENT_ID = ‘’                               # application ID
OAUTH_TOKENS_VKONTAKTE_CLIENT_SECRET = ‘’                           # application secret key
OAUTH_TOKENS_VKONTAKTE_SCOPE = [‘wall’, ‘friends’]                  # application scope
OAUTH_TOKENS_VKONTAKTE_USERNAME = ‘’                                # user login
OAUTH_TOKENS_VKONTAKTE_PASSWORD = ‘’                                # user password
OAUTH_TOKENS_VKONTAKTE_PHONE_END = ‘’                               # last 4 digits of user mobile phone## FacebookOAUTH_TOKENS_FACEBOOK_CLIENT_ID = ‘’                                # application ID
OAUTH_TOKENS_FACEBOOK_CLIENT_SECRET = ‘’                            # application secret key
OAUTH_TOKENS_FACEBOOK_SCOPE = [‘offline_access’]                    # application scope
OAUTH_TOKENS_FACEBOOK_USERNAME = ‘’                                 # user login
OAUTH_TOKENS_FACEBOOK_PASSWORD = ‘’                                 # user password# SettingsOAUTH_TOKENS_HISTORY = True # to keep in DB expired access tokens# Dependenciesdjangorequestsrequests_oauthlibdjango-taggitbeautifulsoup4In order to test with quicktest.py, you also need:mockfactory_boy
Package: django-oauth-toolkit
OAuth2 goodies for the Djangonauts!If you are facing one or more of the following:Your Django app exposes a web API you want to protect with OAuth2 authentication,You need to implement an OAuth2 authorization server to provide tokens management for your infrastructure,Django OAuth Toolkit can help you providing out of the box all the endpoints, data and logic needed to add OAuth2
capabilities to your Django projects. Django OAuth Toolkit makes extensive use of the excellentOAuthLib, so that everything isrfc-compliant.Reporting security issuesPlease report any security issues to the JazzBand security team at <security@jazzband.co>. Do not file an issue on the tracker.RequirementsPython 3.7+Django 2.2, 3.2, 4.0 (4.0.1+ due to a regression), 4.1, or 4.2oauthlib 3.1+InstallationInstall with pip:pip install django-oauth-toolkitAddoauth2_providerto yourINSTALLED_APPSINSTALLED_APPS=(...'oauth2_provider',)If you need an OAuth2 provider you’ll want to add the following to your urls.py.
Notice thatoauth2_providernamespace is mandatory.urlpatterns=[...path('o/',include('oauth2_provider.urls',namespace='oauth2_provider')),]ChangelogSeeCHANGELOG.md.DocumentationThefull documentationis onRead the Docs.Licensedjango-oauth-toolkit is released under the terms of theBSD license. Full details inLICENSEfile.Help WantedWe need help maintaining and enhancing django-oauth-toolkit (DOT).Join the teamPlease consider joiningJazzband(If not
already a member) and theDOT project
team.How you can helpSee ourcontributinginfo and the openissuesandPRs,
especially those labeledhelp-wanted.Submit PRs and Perform ReviewsPR submissions and reviews are always appreciated! Since we require an
independent review of any PR before it can be merged, having your second
set of eyes looking at PRs is extremely valuable.Please don’t merge PRsPlease be aware that we don’t wanteveryJazzband member to merge PRs
but just a handful of project team members so that we can maintain a
modicum of control over what goes into a release of this security oriented code base. Onlyproject
leadsare able to
publish releases to Pypi and it becomes difficult when creating a new
release for the leads to deal with “unexpected” merged PRs.Become a Project LeadIf you are interested in stepping up to be a Project Lead, please join
thediscussion.
Package: django-oauth-usp
Django OAuth USPEste pacote permite que usuários façam login utilizando a senha única USP.Além da autenticação OAuth este pacote também possui migrations para o armazenamento dos
usuários no banco de dados.É recomendado que a estas migrations sejam rodadas antes de qualquer outra migration, devido
a dificuldade de alteração do model User depois de realizada a primeira migration:Using a custom user model when starting a projectComo usarAdicione "django_oauth_usp" em INSTALLED_APPS no arquivo settings.pyINSTALLED_APPS = [
    ...
    'django_oauth_usp.accounts',
]Adicone o Middleware OAuthUspMiddlewareMIDDLEWARE = [
    ...
    'django_oauth_usp.accounts.middleware.OAuthUspMiddleware',
]No arquivo settings.py, informe o Model que será utilizado para armazenar os usuários```
 AUTH_USER_MODEL= 'accounts.UserModel'
 ```Defina os parâmetro para OAuth::OAUTH_CALLBACK_ID = 'callback_id_da_aplicação'

AUTHLIB_OAUTH_CLIENTS = {
    'usp': {
        'client_id': 'meu_client_id',
        'client_secret': 'meu_secret_key'
    }
}

#Rota utilizada para a view accounts_authorize
REDIRECT_URI = '/auth/authorize'

#Lista com o código das unidades que poderão ter acesso.
ALLOWED_UNIDADES = [12, 13, 14]Rode as migrations::python manage.py migrateAdicione rotas para as views accounts_login e accounts_authorize::urlpatterns = [
    path('login', accounts_login, name='login'),
    path('authorize', accounts_authorize, name='authorize'),
]Dados do usuárioOs model UserModel provê os seguintes dados do usuárioNome completouser.get_full_name()Primeiro nome()user.get_short_name()Emailuser.email_user()Telefoneuser.get_phone()É servidoruser.is_servidor()Funçãouser.get_funcao()Vínculouser.get_vinculo()Setoruser.get_setor()
Package: django-obfuscate
Django app to obfuscate text data.Table of contents:Compatibility;How to install;Example usage;Settings reference;License.CompatibilityTested with python 2.7, 3.4, 3.5, 3.6 and Django 1.9, 1.10, 1.11:Travis CIHow to installTo install the app run:$pipinstalldjango-obfuscateor add it to the list of requirements of your project.Then add ‘obfuscator’ to your INSTALLED_APPS.INSTALLED_APPS=[...'obfuscator',]Example usageOn you django project settings, configure the model names and field
names to be obfuscated:OBFUSCATOR={'FIELDS':{'app_label.ModelClass1':['field1','field2','field3'],'app_label.ModelClass2':['field1'],//...}}Run the management command to start obfuscation:$pythonmanage.pyobfuscateYou can run the management command passing as arguments: a model class
path and a list of fields to obfuscate (thus will ignoreFIELDSsetting):$pythonmanage.pyobfuscate--model=app_label.ModelClass1--fields=field1,field2,field3Settings referenceOBFUSCATOR_CLASSDefault:obfuscator.utils.ObfuscatorUtilsPath to class where obfuscator methods are defined. By default, the
class define tow obfuscator methods: *text- Obfuscate simple text
data, respectingmax-lengthfield parameter; *email-
Obfuscate email data. Only text before@is obfuscated, respectingmax-lengthfield parameter.This class also define anobfuscatemethod. This method use fields
mapping (seeFIELDS_MAPPINGsetting) to route the field type with
the obfuscate method.You can redefine this class by subclassing the default class and
changing this setting to point to your class.FIELDS_MAPPINGDefault:{models.CharField:'text',models.TextField:'text',models.EmailField:'email'}Map django model field types with obfuscator methods.FIELDSDefault:{}Fields to be obfuscated and respective model class path. Must be adictwith keys as python dot notation to path where the models are
declared and the values must be declared as lists of model fields.If no value defined, the management command will do nothing.Example:{'contenttypes.ContentType':['model','label'],//...}LicenseMIT license, see the LICENSE file. You can use obfuscator in open source
projects and commercial products.
Package: django-object-attachments
Allows you to add attachments to any object. Extends the object’s model admin
with a tabular inline for adding documents. This is based ondjango-fileranddjango-document-library.InstallationYou need to install the following prerequisites in order to use this app:Djangodjango-cmscmsplugin-blogdjango-filerdjango-document-libraryIf you want to install the latest stable release from PyPi:$ pip install django-object-attachmentsIf you feel adventurous and want to install the latest commit from GitHub:$ pip install -e git://github.com/bitmazk/django-object-attachments.git#egg=object_attachmentsAddobject_attachmentsto yourINSTALLED_APPS:INSTALLED_APPS = (
    ...,
    'object_attachments',
)Run the migrations:./manage.py migrate object_attachmentsUsageIn your project’smodels.pyor any file that get’s loaded early, do the
following:from yourapp.admin import YourAdmin
from object_attachments.admin import ObjectAttachmentInline

YourAdmin.inlines = YourAdmin.inlines[:] + [ObjectAttachmentInline]RoadmapCheck the issue tracker on github for milestones and features to come.
Package: django-object-checker
django-object-checkerHello. I'm just an abstract object 📦 and I would be very glad to have user authorization because I hate criminals 🦹‍♂️ like pedophiles, robbers, hackers and so on.IntroductionProject django-object-checker extends standard django role base access control to be able to check individual object types.Main purpose of this extended authorization system is to maintain control for each objects individually with modular solution.Installation# pippipinstalldjango-object-checker# pipenvpipenvinstalldjango-object-checker# poetrypoetryadddjango-object-checkerSetupJust add checkers module path tosettings.OBJECT_CHECKERS_MODULE:The path is path to the module, where you going to implement all your checkers.
This is required for our BaseObjectChecker to be able to find his subclasses.OBJECT_CHECKERS_MODULE='app.checkers'Example1. Create module according to specified path in settings2. Create your own RBAC ObjectChecker or ABAC ObjectChecker class with checker methodValid check methods are only these, which name starts withcheck_.
So if you want to implement your custom methods which you want to be ignored by CheckingManager your hands are free.RbacCheckerfromdjango.contrib.auth.modelsimportGroup,Userfromobject_checker.base_object_checkerimportRbacCheckerclassMyObjectChecker(RbacChecker):@staticmethoddefcheck_my_object(role:Group,user:User,obj):result=Falseifrole.name=='manager':result=TruereturnresultAbacCheckerfromdjango.contrib.auth.modelsimportUserfromobject_checker.base_object_checkerimportAbacCheckerclassMyObjectChecker(AbacChecker):@staticmethoddefcheck_my_object(user:User,obj):ifuser.has_specific_attribute:returnTruereturnFalse3. Add new object check class to module__init__.pyfromapp.checkers.my_object_checkerimportMyObjectChecker4. Example usage of your custom object checker in your projectMethod to check ishas_object_permissionand has three arguments:name of check methoduser objectobject/objects to be checkedfromobject_checker.base_object_checkerimporthas_object_permissionifhas_object_permission('check_my_object',user,my_object):print('User has access to this/these object/objects.')else:print('User has NOT access to this/these object/objects.')Made with ❤ byAdam Žúrek&BACKBONE s.r.o.0.1.0 : 2020-09-23Initial release0.1.1 : 2020-10-05🌧 Changed Django version requirement from 3.0.* to >= 2.00.1.2 : 2020-10-15😺 Fixed issue, when user has no role, but has permissions and object_checker returned false.0.1.3 : 2020-11-02🐄 Updated version in pyproject.toml file and fixed date in CHANGELOG.md.1.0.0 : 2020-11-24🐂 Added possibility to implement checkers by RBAC or ABAC standards.1.0.1 : 2022-05-23🐕‍🦺 Added possibility to write custom classes (inherited from ABAC and RBAC).1.0.2 : 2022-05-25🦧 Added kwargs to checker methods.
Package: django-objectcounters
Object Counters for Django==========================This is a simple app for associating named integer values witharbitrary Django model objects.Using counters allows you to keep scalar values out of your models.Instead of this:class Person(models.Model):name = models.CharField(...)number_of_friends_total = models.IntegerField(...)number_of_friends_recent = models.IntegerField(...)number_of_friends_last_month = models.IntegerField(...)You can do this:capt = Person.objects.get(name='Jean-Luc Picard')Counter.objects.create_for_object('friends_total', capt, 1014)And:last = Counter.objects.get_for_object('friends_last_month', capt)last.value += -3 # lost the away team.last.save()The approach of reading and writing values in a separate model allowsyou to evolve some of your data without touching the models.  And itkeeps your models a bit more tidy.Install-------Pull down the app:$ pip install django-objectcountersAdd it to your `INSTALLED_APPS`:INSTALLED_APPS = (...'objectcounters')Sync your database:$ ./manage.py syncdb --migrateTo run the sample app, make sure you've got generic admin installed globally(ugh), or better yet, create a new virtual env and install it there with thesample.Python Usage-------------The `Counter` model is a regular Django model, so you can create, read, updateand delete records in the usual way.  Additionally, the model provides a managerwith a few more methods:1.  `Counter.get_for_object(name, instance, **kwargs)`Use this method to get an existing counter for an object.  Pass in the name ofthe counter, like 'total-holodeck-hours', and a model instance.  Keywordarguments are passed thru to the `get()` call.2.  `Counter.get_value_for_object(self, name, instance, default=0, **kwargs)`Use this method when you need just the value of a counter and not the counterrecord.  Keyword arguments are passed thru to the `get()` call.3.  `Counter.create_for_object(self, name, instance, value=0)`This is just like Django's `get_or_create` and returns the same kind oftwo-tuple.  Use this when you need to get a counter and create it if necessaryin one step.Template Usage--------------You can also enable counters inside of templates pretty easily.In your templates, load the tag:`{% load counter_tags %}`Then you can render values like this:<span>{% counter_for_object "monthly_shack_visits" user as visits %}I  went to Shake Shack {{ visits }} times this month.`</span>