Saravanan666/pypi-org huggingface dataset:
Package: django-auth-oidc
This is a Django login view that authenticates against an OpenID Connect
Authentication Server.Use it if you own a single Authentication Server that you want to share
between multiple apps.What is OpenID Connect?It’s a OAuth2-based standard for authentication in applications.It can be used for social logins (but we recommendAiakosif you need
more than one), and for setting up Single Sign-On into multiple services
hosted by the same company. In the last case, it somewhat supersedes LDAP,
as with OIDC people are entering their credentials only into the views
served by the Authentication Server, and not into all the company’s
applications.RequirementsPython 2.7 / 3.5+Django 1.8+openid-connectInstallationpipinstalldjango-auth-oidcsettings.pyINSTALLED_APPS+=['django_auth_oidc']urls.pyurlpatterns+=[url(r'^auth/',include('django_auth_oidc.urls')),]ConfigurationAuthorization ServerApp’s redirect URI: http(s)://app-domain/auth/done
App’s post-logout redirect URI: http(s)://app-domain/LOGOUT_REDIRECT_URL(or / if not set)Authorization Server detailsYou may specify following settings in the Django settings file:AUTH_SERVER - OpenID Connect Authorization Server URL.AUTH_CLIENT_ID - Client ID received from the Authorization ServerAUTH_CLIENT_SECRET - Client secret received from the Authorization ServerAUTH_PROTOCOL (optional) - Legacy protocol supported byopenid-connectlibrary, for example github or gitlab. Seeopenid-connect’s documentation for full list of supported protocols.Or, alternatively, you may set the AUTH_URL environment variable:AUTH_URL=(protocol+)http(s)://client_id:client_secret@server/(Note: “:”, “@”, “/” and “%” inside client_id and client_secret must be urlquoted.)BehaviorAUTH_SCOPE (default: [‘openid’]) - list of scopes to request from the auth serverAUTH_GET_USER_FUNCTION (default: ‘django_auth_oidc:get_user_by_username’) - name of a function that takes the user info dict, and returns an user object representing that user; note that it should set the user.backend attribute.
Package: django-author
Update author and updated_by fields of models automaticallyThis library is used for updatingauthorandupdated_byfields automatically
withrequest.userwhen the model has created/changed.Also if you are too lazy to writeauthor = models.ForeignKey(User,_('author'),related_name...)to every model,
just add@with_authordecorator to the top of class makes you happy.InstallThis library is on PyPI so you can install it with:pip install django-authoror from github:pip install git+https://github.com/lambdalisue/django-author.gitUsageAdd'author'to yourINSTALLED_APPSon settings.pyAdd'author.middlewares.AuthorDefaultBackendMiddleware'to yourMIDDLEWARE_CLASSESif you use default author backendAddauthorandupdated_byfield to models which you want to haveauthorandupdated_byfields manually
or use@with_authordecorator like below:from django.db import models
from author.decorators import with_author

@with_author
class Entry(models.Model):
    title = models.CharField('title', max_length=50)
    body = models.TextField('body')Done. Now you have automatically updatedauthorandupdated_byfieldsIf you are in truble, seeauthor_testdirectory for usage sample.If you want to forbid modification of theupdated_byfield for some actions, just setinstance._change_updated_by = Falsebefore callingsave().SettingsAUTHOR_BACKENDClass or string path of backend. the backend is used to determine user when object is created/updated.AUTHOR_CREATED_BY_FIELD_NAMEA name of field. the setting also interfer the name of field created by@with_authordecorator. default is ‘author’AUTHOR_UPDATED_BY_FIELD_NAMEA name of field. the setting also interfer the name of field created by@with_authordecorator. default is ‘updated_by’AUTHOR_DO_NOT_UPDATE_WHILE_USER_IS_NONEDo not updateauthororupdated_byfield when detected user is None. default is TrueAUTHOR_MODELSCheck signals for only these models. default is NoneAUTHOR_IGNORE_MODELSDo not check signals for these models. default is [‘auth.user’, ‘auth.group’, ‘auth.permission’, ‘contenttype.contenttype’]BackendThe default backend usethread_localsstorategy to get current request in signal call.If you want to change the strategy or whatever, create your own backend.A backend is a class which haveget_usermethod to determine current user.AuthorDefaultBackendDefault backend. This backend return None when no request found or AnonymousUser create/update object.AuthorSystemUserBackendSystem user backend. This backend return system user when no request found or AnonymousUser create/update object.system user is determined withget_system_usermethod and default isUser.objects.get(pk=1)
Package: django-authorize
=====Authorize=====|travis| |codacy| |coverage| |pypipackage|Authorize is a simple Django authentication app to to provide role basedauthentication for users.Detailed documentation will be uploaded soon.Quick start-----------1. Install "authorize" like this::pip install django-authorize2. Add "authorize" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'authorize',]3. Include the authorize URLconf in your project urls.py like this::path('auth/', include('authorize.urls')),4. Include the authorize API URLconf in your project urls.py like this::path('auth/api/' include('authorize.api.urls'))5. Run `python manage.py migrate` to create the authorize models.6. Start the development server and visit http://127.0.0.1:8000/auth/to view authorize index... |travis| image:: https://travis-ci.org/hchockarprasad/django-authorize.svg?branch=master:target: https://travis-ci.org/hchockarprasad/django-authorize.. |codacy| image:: https://api.codacy.com/project/badge/Grade/094403a27f8843f388824c2d2ab1e3b1:alt: Codacy Badge:target: https://www.codacy.com/app/hchockarprasad/django-authorize?utm_source=github.com&utm_medium=referral&utm_content=hchockarprasad/django-authorize&utm_campaign=badger.. |pypipackage| image:: https://img.shields.io/pypi/v/django-authorize.svg.. |coverage| image:: https://img.shields.io/codecov/c/github/hchockarprasad/django-authorize/master.svg:target: https://codecov.io/gh/hchockarprasad/django-authorize
Package: django-authorship
A set of Django mixins to easily record authorship information for your models.FeaturesBase model allows easy recording of authorship information.Integration with Django’s class-based views and forms.Integration with Django’s admin.DocumentationThe full documentation is athttps://django-authorship.readthedocs.io/QuickstartInstalldjango-authorshipusing the installation instructions found in the project documentation.Build a model based onauthorship.models.Authorshipto record authorship information on it:from authorship.models import Authorship

class MyModel(Authorship):

    passThis addscreated_by,created_at,updated_by, andupdated_atto your model.Pass a user into calls to.save()to record which user changed the object:example = MyModel()
example.save(user=request.user)If you need to update model data and there’s no direct link to a website user, generate and use a site-wide ‘generic’ user.:from authorship.models import get_website_user

example = MyModel()
example.save(user=get_website_user())If you wish to automatically record authorship information for changes made in the Django admin, useauthorship.admin.AuthorshipMixin.:from authorship.admin import AuthorshipMixin
from django.contrib import admin

from .models import MyModel

@admin.register(MyModel)
class MyModelAdmin(AuthorshipMixin, admin.ModelAdmin):

    passIf you wish to integrate withdjango.forms.ModelForm, useauthorship.forms.AuthorshipMixinandauthorship.views.AuthorshipMixin.In yourforms.py:from authorship.forms import AuthorshipMixin
from django import forms

from .models import MyModel

class MyModelForm(forms.ModelForm):

    class Meta(object):
        model = MyModelIn yourviews.py:from authorship.views import AuthorshipMixin
from django.views.generic import CreateView

from .forms import MyModelForm
from .models import MyModel

class MyModelCreateView(AuthorshipMixin, CreateView):

    form_class = MyModelFormMyModelCreateViewwill now automatically passrequest.userthrough toMyModelForm, which will pass it through to the model’ssave()method.CreditsSeeAUTHORS.rst.
Package: django-auth-policy
A future version of this package will get a new name and will become Django
independent, with an optional Django integration module(s).Django Auth Policy is a set of tools to enforce various authentication
policies when using the Django Web Framework (http://www.djangoproject.com/).Available policy rules:disable users that did not login for a certain amount of time;temporarily lock-out users with too many failed login attempts;temporarily lock-out IP addresses with too many failed login
attempts;enforce a minimum password length;enforce password complexity rules;require a password change after a certain period;require a password change when a temporary password has been set,
eg. when the user administrator provides passwords for (new) users.Every policy can be disabled and many configuration options are available,
seedjango_auth_policy/settings.py.Documentation is currently very limited and available in the “docs” directory.To run the test suite runrun-tests.pyortox.
Package: django-auth-protection
Django Auth ProtectionDjango Auth ProtectionThis package logout users from the system by changing the password in REST API.Why Django Auth Protection?Simple JWT provides a JSON Web Token authentication backend for the Django REST Framework. It aims to cover the most common use cases of JWTs by offering a conservative set of default features. It also aims to be easily extensible in case a desired feature is not present. But one of the problems is that when the users change the password, they can continue to work on the system with the previous token until it expires. This package overrides the Simple JWT to solve this problem.How to use itDownload and install latest version of Django Auth Protection:$pipinstalldjango-auth-protection# or$easy_installdjango-auth-protectionThen you have to create a customTokenObtainPairViewclass and change theserializer_classtoProtectTokenObtainPairSerializer(follow the sample):Make a customTokenObtainPairViewand change theserializer_class:fromauth_protection.serializersimportProtectTokenObtainPairSerializerclassCustomTokenObtainPairView(TokenObtainPairView):serializer_class=ProtectTokenObtainPairSerializerChange Allauthentication_classeson your views and replace it withJWTAuthProtection:fromauth_protection.authenticationsimportJWTAuthProtectionclassSampleView(TARGET_VIEW):authentication_classes=[JWTAuthProtection]
Package: django-auth-pubtkt
# django-auth-pubtktAuthor: Alexander VyushkovImplementation of mod_auth_pubtkt: a pragmatic Web Single Sign-On (SSO) solution as Django middleware.This version was tested on Python == 2.7, Django == 1.11It is incompatible with previous versions (use django-auth-pubtkt==1.1.2 for Django 1.5)Please refer to https://neon1.net/mod_auth_pubtkt/index.html for additional details.# Installation from GitHub```bashpip install git+git://github.com/Baguage/django-auth-pubtkt@master#egg=django-auth-pubtkt```# Installation:django-auth-pubtkt uses M2Crypto library. Installation instructions fordifferent platforms are below.When M2Crypto is installed, django-auth-pubtkt can be installed using pippip install django-auth-pubtktor using setuptools./setup.py install# WindowsUse binary package available on http://chandlerproject.org/Projects/MeTooCrypto#Downloads# RedHat 7 + Python 3.5I got "Failed building wheel for m2crypto" when used "pip install m2crypto" command.The library was installed successfully, and all tests passed, somehow.# CentOS 6/RedHat 6/FedoraFedora Core (and RedHat, CentOS etc.) have made changes to OpenSSLconfiguration compared to many other Linux distributions. If you can notbuild M2Crypto normally, try the fedora_setup.sh script included withM2Crypto sources.pip install --download=/tmp M2Crypto==0.21.1cd /tmptar -zxf /tmp/M2Crypto-0.21.1.tar.gzcd M2Crypto-0.21.1./fedora_setup.sh installpython setup.py testNote that setup.py test is required in some cases to fix "ImportError: No module named __m2crypto" error.lease refer to http://stackoverflow.com/questions/4773659/cant-install-a-python-package for additional detailsCentOS 7/RedHat 7 should be fine# ConfigurationAdd 'django_auth_pubtkt.middleware.DjangoAuthPubtkt' to MIDDLEWARE (Django 1.11+)* Change LOGIN_URL to "/sso/"* Set TKT_AUTH_LOGIN_URL to the address of SSO login page* Add piece of code below to urls.py```pythonfrom django.conf.urls import urlfrom django_auth_pubtkt.views import redirect_to_ssourlpatterns = [# ...url('^sso/', redirect_to_sso),# ...]```ORChange LOGIN_URL to the address of SSO login page.Configure your SSO to use 'next' as redirect field name.ORuse @method_decorator(login_required(redirect_field_name="back"))# Configuration variables (settings.py)```TKT_AUTH_PUBLIC_KEYDefault: NoneFilename of DSA public key in .pem format. It is used to verify ticket signature.TKT_AUTH_COOKIE_NAMEDefault: "auth_pubtkt"Name of the authentication cookie to use.TKT_AUTH_USE_GROUPSDefault: FalseTreat tokens as group names. Create groups if they don't exist yet.TKT_AUTH_LOGIN_URLDefault: NoneURL that users without a valid ticket will be redirected toTKT_AUTH_BACK_ARG_NAMEDefault: "back"Name of the GET argument with the originally requested URL (when redirecting to the login page)TKT_AUTH_ANONYMOUS_USERDefault: TrueAdd AnonymousUser object if no auth_pubtkt cookie is found. If set, django_auth_pubtkt can be used as a replacement to AuthenticationMiddleware.If disabled, AuthenticationMiddleware and django_auth_pubtkt can be used together.```
Package: django-auth-remember
Add the auth_remember authentication backend to django:AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'auth_remember.backend.AuthRememberBackend',
)Add the remember middleware in your settings, right after
AuthenticationMiddleware:MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'auth_remember.middleware.AuthRememberMiddleware',
    ...
)Add auth_remember to INSTALLED_APPS:INSTALLED_APPS = (
    'auth_remember',
)Set the cookie name and expire time (optional):AUTH_REMEMBER_COOKIE_NAME = 'remember_token'
AUTH_REMEMBER_COOKIE_AGE = 86400 * 28  # 4 weeks by defaultSet the expire time of the session to browser close (optional):SESSION_EXPIRE_AT_BROWSER_CLOSE = TrueTo remember a user add the following code to your authentication handler:from auth_remember import remember_user
remember_user(request, user)Use the user.is_fresh attribute to test if the user is fresh:{% if user.is_fresh %}
    This user session is fresh
{% else %}
    This user session is NOT fresh
{% endif %}Under the hood auth_remember uses the session varAUTH_REMEMBER_FRESHto
indicate if the user session is fresh. The name of the session var can be
changed by setting theAUTH_REMEMBER_SESSION_KEYin you’re settings file.More informationSee:http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579TODOsIntroduce settings for AUTH_REMEMBER_COOKIE_DOMAIN
Package: django-auth-reports
Django Auth ReportsA Django application that:-Adds csv downloads of group permissions-Adds right-side filtering in m2m filter_horizontal widgetsCompatibilityFor Django 1.x, use django-auth-reports 1.xFor Django 2.x, use django-auth-reports 2.xInstallation$ pip install django-auth-reportsAdd the following to the top of the INSTALLED_APPS in your project's settings file, above django.contrib.admin and django.contrib auth:'auth_reports',Collect static media:manage.py collectstatic
Package: django-auth-role
Add roles to django-authRole are set of group of permissions and permissions. It’s fully customizable. Everything is in database.Admin application allow to manage roles.Installationpipinstalldjango-auth-roleQuick startAddauthroletoINSTALLED_APPS(django.contrib.authanddjango.contrib.contenttypesare also required)
andAuthRoleBackendtoAUTHENTICATION_BACKENDS.INSTALLED_APPS=[...'django.contrib.contenttypes','django.contrib.auth','authrole',]AUTHENTICATION_BACKENDS=('authrole.auth.backends.AuthRoleBackend',)Extendauth.User.fromauthrole.mixinsimportRoleMixinfromdjango.dbimportmodelsclassMyUser(RoleMixin,models.Model):user=models.OneToOneField('auth.User',related_name='user')or create new auth user model:fromauthrole.mixinsimportRoleMixinfromdjango.contrib.auth.modelsimportAbstractUserfromdjango.dbimportmodelsclassMyUser(RoleMixin,AbstractUser):passIn this case remember to setAUTH_USER_MODELto Your model.Create tables../manage.pymigrateAdvanced usageOwn authentication backendIf You need Your own authentication backend, simply extendBaseAuthRoleBackend.fetch_role_permissionsfunction must return a list ofauth.Permissionobjects:fromauthrole.auth.backendsimportBaseAuthRoleBackendfromdjango.contrib.auth.modelsimportPermissionclassMyBackend(BaseAuthRoleBackend):deffetch_role_permissions(self,user_obj):ifuser_obj.username=='admin':returnPermission.objects.all()else:returnPermission.objects.none()Extend roleAddOneToOneFieldto Your model:fromdjango.dbimportmodelsclassMyRole(models.Model):role=models.OneToOneField('authrole.Role',null=False,blank=False,related_name='myrole')extra_field=models.CharField(max_length=10)And use:fromauthrole.modelsimportRolerole=Role.objects.all()[0]print(role.myrole.extra_field)Or write Your own role class based onAbstractRole(Django >= 1.5):fromauthrole.modelimportAbstractRoleclassMyRole(AbstractRole):extra_field=models.CharField(max_length=10)PointAUTHROLE_ROLE_MODELto Your new model:AUTHROLE_ROLE_MODEL='app.MyRole'And use:fromapp.modelsimportMyRolerole=MyRole.objects.all()[0]print(role.extra_field)
Package: django-authsch
LeírásEgyszerűen használható auth.sch kliens. Saját felhasználói modellel is működik, mivel adjango.contrib.auth.get_user_modeláltal visszaadott felhasználói modell-t használja. Azzal a kikötéssel, hogy az
auth.sch-ban használt internal_id-t tárolni kell a user modellben (méghozzáunique=Truemegkötéssel).FüggőségekA django-authsch a requests csomagtól függ. Ezt használja az auth.sch-val folytatott HTTP kommunikációra. Telepíteni a
pip csomagkezelővel tudjuk:pipinstallrequestsTelepítésTelepíteni egyszerűen a PyPI-ből apipsegítségével.pipinstalldjango-authschKonfigurálásAz auth.sch használatához elengedhetetlen, hogy a kliens azonosító:kulcs párokat, az internal_id-t valamint a kért scope-okat
bekonfiguráljuk. Ezen felül beállíthatjuk, hogy a felhasználói modellben melyik mezőben tároljuk a refresh_token-t. Ha
nem adunk meg refresh_token mező nevet, akkor a django-authsch nem próbálja meg elmenteni a refresh tokent.Konfigurálni mindent asettings.py-ban lehet.AUTH_SCH={'CLIENT_ID':'yourClientIdFromhttps://auth.sch.bme.hu/console/index',# kötelező megadni'SECRET_KEY':'yourAwesomeSecretKeyyAlsoFromAuthSCH',# kötelező megadni'SCOPES':[# kötelező megadni a kért scope-okat'basic','displayName','egyszerű','felsorolása','a','kért','scope-oknak','nuff','said'],'INTERNAL_ID_FIELD_NAME':'auth_sch_internal_id',# Ez a default beállítás, ha ettől nem különbözik, akkor nem kötelező megadni'REFRESH_TOKEN_FIELD_NAME':'refresh_token'# Ez a default beállítás, ha ettől nem különbözik, akkor nem kötelező megadni}HasználatAz auth.sch leírása szerint a felhasználó beléptetéséhez össze kell állítani a megfelelő url-t aCLIENT_IDés aSCOPES(+-szal felsorolva) alapján:https://auth.sch.bme.hu/site/login?response_type=code&client_id=**<IdeJönACLIENT_ID>**&state=asd123&scope=**<IdeJönnekAScope-ok>**Ezt az url-t a mellékelt html template tag segítségével lehet a legegyszerűbben előállítani.{%loadauthsch_tags%}<a href="{%authsch_login_url%}">Login with auth.sch</a>Ez után kell elkészíteni a callback View-t. Ez lesz az, amire az auth.sch visszairányítja a felhasználót, és get
paraméterként megadja az access_token lekéréséhez szükséges kódot.classMyCallbackView(CallbackView):success_url='ide irányítod a felhasználót, ha sikeres volt a bejelentkezés'# Kötelezőerror_url='ide irányítod a felhasználót, ha sikertelen volt a bejelentkezés'# Kötelező# Ezeket nem kötelező megadniacquire_access_token_url='https://auth.sch.bme.hu/oauth2/token'# Nem kötelező megadniauth_sch_profile_url='https://auth.sch.bme.hu/api/profile/'# Nem kötelező megadniinternal_id_field_name=None# Nem kötelező megadni, felülírja a settings.py-ban beállított INTERNAL_ID_FIELD_NAME-trefresh_token_field_name=None# Nem kötelező megadni, felülírja a settings.py-ban beállított REFRESH_TOKEN_FIELD_NAME-tModell-ekAz egyetlen modell a csomagban aAbstractAuthSchBase. Ez egy olyan absztrakt modell, ami tartalmazza a működéshez
elengedhetetlen internal_id-t, valamint a refresh token tárolásához használt refresh_token mezőt. Ebből (is) örököltetve
a felhasználói modellt biztosan működni fog.
Package: django-authsimple
simpleauth is a Django app to implement simple authentication
in django project.Quick startAdd “authentication” to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'authentication',]Include the authentication URLconf in your project urls.py like thispath('auth/',include('authentication.urls')),Create a “simpleAuth.py” file at project level(where manage.py is located)DOMAIN="http://127.0.0.1:8000"# for default djangoserver (use your domain name)SENDER_EMAIL_ID="YOUR_MAIL_ID"SENDER_PASSWORD='YOUR MAIL_ID PASSWORD'SERVER_NAME='smtp.gmail.com'# for gmail (use your mail servername)# NOTE : TURN ON LESS SECURE APP OPTION IN UR GOOGLE ACCOUNTRunpython manage.py migrateto create the authentication models.Start the development server and visithttp://127.0.0.1:8000/auth/registerto register user.visithttp://127.0.0.1:8000/auth/loginto login.visithttp://127.0.0.1:8000/auth/logoutto logout.visithttp://127.0.0.1:8000/auth/forgot_passwordto forgot_password.
Package: django_authstrap
Bootstrap templates for django.contrib.authIntroductionDjango comes with a reasonable default authorization module comprising of several useful views such as login and logout, password reset flow and password change flow. Neither the templates for these views nor the urls are part of the standard django distribution. This projects implemnts the missing functionality so you don’t have to.InstallationInstall django-auth-bootstrap-templates:pip install django_authstrapUsageThen use it in a project:Put this in your settings.py:INSTALLED_APPS += 'django_authstrap'
LOGIN_URL = 'auth/login'
LOGOUT_URL = 'auth/logout'Set-up the project urls.py to include auth urls:url(r'^auth/', include('django_authstrap.urls'))Run the dev server and point your browser to a page that required logging in.FeaturesAll tempaltes are based on Bootstrap 2Forms are rendered using the form-horizontal layoutHistory0.1.0 (2013-11-25)First release on PyPI.0.2.0 (2013-11-25)Noe includes a working demo project.
Package: django-auth-style
django-auth-styledjango-auth-style provides Django template styling fordjango-allauthanddjango-oauth-toolkit.Installationdjango-allauth SupportTo enable support for django-allauth, install with:pipinstalldjango-allauthdjango-auth-style[allauth]Then enable the Django app:# settings.pyINSTALLED_APPS=[# Any project-local apps should come before "auth_style",# so templates can be overridden as needed'my_django_app.apps.MyDjangoAppConfig',...,'auth_style',...,# "allauth" must come after "auth_style"'allauth','allauth.account','allauth.socialaccount',]django-oauth-toolkit SupportTo enable support for django-oauth-toolkit, install with:pipinstalldjango-oauth-toolkitdjango-auth-style[oauth-toolkit]Then enable the Django app:# settings.pyINSTALLED_APPS=[# Any project-local apps should come before "auth_style",# so templates can be overridden as needed'my_django_app.apps.MyDjangoAppConfig',...,'auth_style',...,# "oauth2_provider" must come after "auth_style"'oauth2_provider',]UsageWhen django-auth-style is properly installed alongside django-allauth or django-oauth-toolkit,
rendered templates will automatically be overridden with styled alternatives.