Saravanan666/pypi-org huggingface dataset:
Package: django-logic-celery
The main idea ofDjango Logicis to allow developers implementing
business logic via pure functions. Django-Logic-Celery takes care of the connection
between the pure functions and the business requirements, based on a state of the model object.
Please, make sure to make yourself familiar withDjango Logicfirst,
as it implements the core functionality and the very package is the only extension allowing using Celery tasks.InstallationUse the package managerpipto install Django-Logic-Celery.pipinstalldjango-logic-celeryContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMITProject statusUnder development
Package: django-login-auth-app
Login is a Django app to create, authenticate and login users.Detailed documentation is in the “docs” directory.Quick startAdd “login_app” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    "login_app.apps.LoginAppConfig",
]Go to the bottom of your project setting.py and add:AUTH_USER_MODEL = "login_app.User"Include the login_app URLconf in your project urls.py like this:path('auth/', include('login_app.urls')),Runpython manage.py migrateto create the User model.Add your login/signup template to views.py login_viewStart the development server and visithttp://127.0.0.1:8000/auth/loginto see you login page
Package: django-login-canary
django-login-canaryis a reusable Django application to notify users upon successful and failed logins.LicenseMITInstallationInstall from PyPI:pip install django-login-canaryAdd'login_canary'to yourINSTALLED_APPS:INSTALLED_APPS = [
    # ...
    'login_canary',
]ConfigurationLOGIN_CANARY_NOTIFY_FAILED_LOGINNotify users upon failed logins. Use with caution!Default:FalseLOGIN_CANARY_NOTIFY_LOGINNotify users upon successful logins.Default:TrueLOGIN_CANARY_SERVICE_NAMEThe name of your service. Required. String
Package: django-logingov-backend
Django OpenID Connect (OIDC) authentication providerThis module makes it easy to integrate OpenID Connect as an authentication source in a Django project.Behind the scenes, it uses Roland Hedberg's great pyoidc library.Modified by JHUAPL BOSS to support Python3Modified by Thomas Frössman with fixes and additional modifications.A note for anyone viewing this file from the .gov repository:This code has been included from its upstream counterpart in order to minimize external dependencies. Here is an excerpt from setup.py::name='django-oidc-tf',
description="""A Django OpenID Connect (OIDC) authentication backend""",
author='Thomas Frössman',
author_email='thomasf@jossystem.se',
url='https://github.com/py-pa/django-oidc',
packages=[
    'djangooidc',
],
include_package_data=True,
install_requires=[
    'django>=1.10',
    'oic>=0.10.0',
],It was taken fromhttps://github.com/koriaf/django-oidcat ae4a0ba5e6bfda1495f9447a507e6f54cc056980.
Package: django-login-history2
django-login-history2django-login-history2is an enhanced version of the "django-login-history" package,
providing a simple and effective way to track user login history in a Django project.FeaturesEverything the previous package didSupport maintainedWe use ipware instead of ipaddressInstallationInstalldjango-login-history2using pip:pipinstalldjango-login-history2Add 'login_history' to your INSTALLED_APPS in the Django configuration file (settings.py):INSTALLED_APPS=[# ...'django_login_history2',# ...]Run migrations to create the required database tables:pythonmanage.pymigrateUsagedjango-login-history2 is easy to use. It will start automatically recording login history once installed and configured.
Package: django-login-required-middleware
django-login-required-middlewaredjango-login-required-middlewareprovide login to all requests through middleware.If the website has many views and almost all useLoginRequiredMixinor thelogin_requireddecorator, usingdjango-login-requiredcan keep the code of your views more clear and avoids forgetting authentication of view.RequirementsPython3.8 to 3.10 supported.Django3.2 to 4.1 supported.Quick startInstallpip install django-login-required-middlewareAddlogin_required.middleware.LoginRequiredMiddlewaretoMIDDLEWAREafterdjango.contrib.auth.middleware.AuthenticationMiddleware(Optional) To ignore authentication in a view uses decorato@login_not_requiredfor FBV orLoginNotRequiredMixinfor CBV:fromlogin_requiredimportlogin_not_required@login_not_requireddefmy_view(request):returnHttpResponse()orfromlogin_requiredimportLoginNotRequiredMixinclassMyView(LoginNotRequiredMixin,View):defget(self,request,*args,**kwargs):returnHttpResponse()(Optional) AddLOGIN_REQUIRED_IGNORE_PATHSsetting.
Any requests which match these paths will be ignored. This setting should be a list filled with
regex paths (settings.LOGIN_URLalways included).Example:LOGIN_REQUIRED_IGNORE_PATHS=[r'/accounts/logout/$',r'/accounts/signup/$',r'/admin/$',r'/about/$'](Optional) AddLOGIN_REQUIRED_IGNORE_VIEW_NAMESsetting.
Any requests which match these url name will be ignored. This setting should be a list filled with
url names.Example:LOGIN_REQUIRED_IGNORE_VIEW_NAMES=['home','admin:index','admin:login','namespace:url_name',](Optional) AddLOGIN_REQUIRED_REDIRECT_FIELD_NAMEsetting.
This will be passed to Django's redirect_to_login().  Default is 'next'.Example:LOGIN_REQUIRED_REDIRECT_FIELD_NAME='next_url'
Package: django-loginurl
This is a simple application for Django that allows an anonymous visitor to
log in as a user by only visiting a URL.By default, the URL is only valid once and cannot be used multiple times.
Other schemes that involve the number of visit and/or an expiry date can
also be created. For example, it is possible to create a log in URL that
only valid for 5 visits before next week using this application.ConfigurationAdd django-loginurl application into your Django project. Modify yoursettings.pylike the following:INSTALLED_APPS = (
    ...
    'loginurl',
    ...
)Add the authentication backend of this django-loginurl application to
your project’ssettings.py.AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'loginurl.backends.LoginUrlBackend',
)The first authentication backend is the default and if your project uses
the Django’s standard authentication mechanism, you will need that.Consult the Django documentation for more information regarding the
backend. Seehttp://docs.djangoproject.com/en/dev/topics/auth/#other-authentication-sourcesInclude the application’surls.pyto your project.urlpatterns = patterns('',
    ...
    (r'^loginurl/', include('loginurl.urls')),
    ...
)This will make requests tologinurl/are handled by django-loginurl.
If the configuration is put inside the project’surls.py, the log in
URL will look like the following:http://example.com/loginurl/a-secret-keyScheduled TaskTo keep your database clean from expired secret keys, a scheduled task need
to be set up. This task should do one of the following.Callloginurl_cleanupcommand from the Django’s management script, orOpen a special URL that will trigger the clean up,loginurl/cleanup/.
e.g.http://example.com/loginurl/cleanup/You can use crontab or the web based one to set this up. A daily or weekly
task should be enough.UsageIf your application need to create a one time log in URL, what you need to
do is callingloginurl.utils.createwith a user object as the parameter.
The resulting object is an instance ofloginurl.models.Keythat has a
property calledkeythat contains a unique key for the log in URL.import loginurl.utils

def create_login_url(user):
    key = loginurl.utils.create(user)
    url = 'http://example.com/loginurl/%s' % key.key

    return urlAcknowledgementThis code has been developed in the context of the research activities of the
FET project (Grant agreement no. 231807).Epiwork: developing the framework for an epidemic forecast infrastructure.Seehttp://www.epiwork.eu/
Package: django-logon-testcase
Simple enhancement to the TestCase which creates user and loggs him in.DocumentationThe full documentation is athttps://django-logon-testcase.readthedocs.io.QuickstartInstall Django Logon TestCase:pip install django-logon-testcaseUse it in your tests:fromdjango.testimportTestCasefromlogon_testcaseimportLogonMixinclassMyTestCase(LogonMixin,TestCase):...The logged user is available inself.uservariable.FeaturesYou can get your own user for the test by overridingget_userfunction:classMyTestCase(LogonMixin):defget_user(self):returnUser.objects.create()Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-08-10)First release on PyPI.
Package: django-log-outgoing-requests
1django-log-outgoing-requestsVersion:0.6.1Source:https://github.com/maykinmedia/django-log-outgoing-requestsKeywords:logging, django, requestsPythonVersion:3.8+A logging solution for outgoing requests made via therequestslibrary.django-log-outgoing-requests provides a custom formatter and handler for the Pythonloggingstandard library. It integrates with existing logging configuration and
provides (configuration) options to save the log records to the database.You would typically use this as a tool to debug integration with external HTTP services,
via log shipping solutions and/or the Django admin.Contents1django-log-outgoing-requests2Features3Usage4Local development2Featureslog formatter for a readable representation of a request and responselog handler to persist relevant log records to the databaseconfigurable via Django settingsruntime configuration in the admin, overriding defaults from Django settings.3UsagePlease see the hosteddocumentationfor installation, configuration and usage
instructions.4Local developmentTo install and develop the library locally, use:pipinstall-e--no-build-isolation.[tests,coverage,docs,pep8,release]
Package: django-logpipe
django-logpipeDjango-logpipe is a library that serves as a universal pipe for moving data around between Django applications and services. It supports serialization by means ofDjango REST Frameworkand/orPydantic, and supports using eitherApache Kafka] orAmazon Kinesisas the underlying data stream.DocumentationSeehttps://thelabnyc.gitlab.io/django-logpipe/Change logSeeRelease Notes
Package: django-log-reader
Django Log ReaderDjango Log Readerallows you to read & download log files on the admin page.This version designed for the Linux operating system and uses Linux commands to read files faster.Why Django Log Reader?Reading files based on Linux commands speeds up the display of file contentSearch in files based on Linux commandsDownload the result of the contentDisplay all files according to the pattern defined in thesettings.pySimple interfaceEasy integrationHow to use itDownload and install latest version of Django Log Reader:$pipinstalldjango-log-reader# or$easy_installdjango-log-readerAddlog_readerapplication to theINSTALLED_APPSsetting of your Django projectsettings.pyfile:INSTALLED_APPS=(# ..."log_reader.apps.LogReaderConfig",)You can Add the following value In yoursettings.pyfile:# This value specifies the folder for the files. The default value is 'logs'LOG_READER_DIR_PATH='logs'# This value specifies the file extensions. The default value is '*.log'LOG_READER_FILES_PATTERN='*.log'# This value specifies the default file. If there is no filter, the system reads the default file.LOG_READER_DEFAULT_FILE='django.log'# The contents of the files are separated based on this pattern.LOG_READER_SPLIT_PATTERN="\\n"# This value indicates the number of lines of content in the file. Set the number of lines you want to read to this value.LOG_READER_MAX_READ_LINES=1000# You can exclude files with this value.LOG_READER_EXCLUDE_FILES=[]Collect static if you are in production environment:$pythonmanage.pycollectstaticClear your browser cacheStart the app# Set up the database$pythonmanage.pymakemigrations
$pythonmanage.pymigrate# Create the superuser$pythonmanage.pycreatesuperuser# Start the application (development mode)$pythonmanage.pyrunserver# default port 8000Access theadminsection in the browser:http://127.0.0.1:8000/
Package: django-log-register
Log Register Documentation==========================:Author:Leandro Gomez <leandro.gz73@gmail.com>:Version: 0.0.3::pip install django-log-register==0.0.3Django Log Register is a simple application for Django.It's a simple way to save this error, warning, success, info, and debug log; everything in database.You can reference to another model in database, to be able to know who makes you system fails.``Lot``: It's a lot of logs where you can register error, warning, info, debug or success logs (See details below).``Log``: This is a error, a warning or another message level (by default the same of django message) with the reason.``Examples:``Suppose that you want to register each successful creation of a model, or its fail if it's not createdcreation_logs = Lot()for n in range(10):try:obj = SomeModel(attr=1, attr=2)obj.save()creation_logs.success("A obj has been created!") #Only the reason param is required!except Exception as e:creation_logs.error("A obj has not been created!")creation_logs.close() #Don't forget to close the Lot, this can indicate you if the process finished fine.Now suppose the same context, but you want the real exception and some context to can find a solution.creation_logs = Lot()for n in range(10):try:attr1 = some_calculated_value()attr2 = 20obj = SomeModel(attr1=attr1, attr2=attr2)obj.save()creation_logs.success("A obj has been created!","with attr1=%(attr1)s and attr2=%(attr2)s" % dict(attr1=attr1, attr2=attr2)) #You can add some extra_data if you wish or need itexcept Exception as e:context = "attr1=%(attr1)s and attr2=%(attr2)s" % dict(attr1=attr1, attr2=attr2)creation_logs.error(str(e), context)#make a str(e) is my favourite way to register a error log, and let the extra_data provide me# what I need to solve the problem.creation_logs.close()Now suppose that you are updating many instances of models, and can register which model update has fail.creation_logs = Lot()for id in range(5):try:obj = MyModel.objects.get(id=id)making_something(obj)creation_logs.success("A obj has been update!")except SomeException as e:context = "model=%(model)s and id=%(id)s" % dict(model=model, id=id)if 'obj' in locals()::creation_logs.error(str(e), context, log_object=obj)else:creation_logs.error(str(e), context)creation_logs.close()But you maybe want to even logs for a object in the same Lot; so... you can make this:from lot_register.actions import get_lot_for_objectsobj1 = MyModel()onj2 = MySecondModel()lot = get_lot_for_objects(obj1)# make something with obj1 and obj2lot.log("I make something with my obj1 with another obj2!!", "some extra data",log_object=obj2)#or...try:obj1.make_something(obj2)except:lot.error("Something went wrong", log_object=obj2)
Package: django-logs
Tracking changes to django models.Model fields for keeping track of the user and session that created and modified a model instance.Abstract model class with fieldscreated_byandmodified_byfields.A model manager class that can automatically track changes made to a model in the database.Quickstart GuideInstall it with pip from PyPi:pip install django-logsAddlogs.middleware.UserLoggingMiddlewareto yourMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES = (
    ...
    'logs.middleware.UserLoggingMiddleware',
)To just track who created or edited a model instance just make it inherit fromAuthStampedModel:from logs.models import AuthStampedModel

class WarehouseEntry(AuthStampedModel):
    product = models.ForeignKey(Product)
    quantity = models.DecimalField(max_digits = 10, decimal_places = 2)This will add 4 fields to theWarehouseEntrymodel:created_by- A foreign key to the user that created the model instance.created_with_session_key- Stores the session key with which the model instance was first created.modified_by- A foreign key to the user that last saved a model instance.modified_with_session_key- Stores the session key with which the model instance was last saved.If you want to track full model change history you need to attach anAuditLogmanager to the model:from django.db import models
from logs.models.fields import LastUserField
from logs.models.managers import AuditLog


class ProductCategory(models.Model):
    name = models.CharField(max_length=150, primary_key = True)
    description = models.TextField()

    logs = AuditLog()

class Product(models.Model):
    name = models.CharField(max_length = 150)
    description = models.TextField()
    price = models.DecimalField(max_digits = 10, decimal_places = 2)
    category = models.ForeignKey(ProductCategory)

    logs = AuditLog()You can then query the audit log:In [2]: Product.logs.all()
Out[2]: [<ProductAuditLogEntry: Product: My widget changed at 2011-02-25 06:04:29.292363>,
        <ProductAuditLogEntry: Product: My widget changed at 2011-02-25 06:04:24.898991>,
        <ProductAuditLogEntry: Product: My Gadget super changed at 2011-02-25 06:04:15.448934>,
        <ProductAuditLogEntry: Product: My Gadget changed at 2011-02-25 06:04:06.566589>,
        <ProductAuditLogEntry: Product: My Gadget created at 2011-02-25 06:03:57.751222>,
        <ProductAuditLogEntry: Product: My widget created at 2011-02-25 06:03:42.027220>]
Package: django-logtailer
Version:1.2Source:http://github.com/fireantology/django-logtailer/Allows the viewing of any log file entries in real time directly from the Django admin interface.
It allows you to filter on logs with regex and offer also a log clipboard for save desired log lines to the django db.DemosDemoVideoRequirementsDjango > 1.8Python 3.x or 2.XSessions enabledInstallationInstall the package with pip install django-logtailerAdd it to the INSTALLED_APPS in your SETTINGSadd to urls.py: url(r’^logs/’, include(‘logtailer.urls’)),Run manage.py migrate for create the required tablesRun manage.py collectstatic
Package: django-logto
External and BrowsableAPI AuthenticationThis README.md assumes that you already set up a Logto app for your front-end application.First at all, use the commandpython manage.py migrateto change the user model.You will now have to add the logto urls:url_patterns=[path('auth/',include('django_logto.urls')),]To use External Authentication and BrowsableAPI authentication, you need to change the default Authenticationclass in your settings. \REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':("django_logto.authentication.LogtoAuthentication",),}You need to set in settings.py:LOGTO_AUDIENCE="**your_api_url**"#(e.g. : http://localhost:8000)LOGTO_JWKS_URIS="**<logto_url>/oidc/jwks**"LOGTO_ENDPOINT="**your_logto_url**"LOGTO_API_CLIENT_ID="**your_TraditionalWebApp_id**"LOGTO_API_SECRET="**your_TraditionalWebApp_secret**"LOGTO_API_REDIRECT_URI="**<your_api_url>/auth/callback/**"LOGTO_CALLBACK_URI="**<your_api_url>/api/**"#(this one can be changed, depending on your needs. For more information, you can refer to the Logto documentation )For BrowsableAPI authentication, you can authenticate threw /auth/signinDjangoAdmin AuthenticationSet theAUTH_USER_MODELandAUTHENTICATION_BACKENDSin settings: \AUTHENTICATION_BACKENDS=["django_logto.logto_backend.LogtoBackend"]AUTH_USER_MODEL="django_logto.LogtoUser"Add the related Machine-To-Machine Logto app environment variables:LOGTO_ADMIN_CLIENT_ID="**<your_m2m_app_id>**"LOGTO_ADMIN_CLIENT_SECRET="**<your_m2m_app_secret>**"This package accesses to Logto ManagementAPI to retrieve the actual connected user's roles.You will need to give your M2M app the permission to access to ManagementAPI (don't forget to set the role as "Machine-to-machine app role"):https://docs.logto.io/docs/recipes/rbac/manage-permissions-and-roles/#create-and-define-a-new-roleThis package also expects (by default) to receive an "admin" role from the managementAPI to give the user the right to access the admin console by creating a role with name="admin" (don't forget to set the role as "User role").You can override it by defining another admin tags in settings.py: \LOGTO_ADMIN_TAG=["<1st_admin_tag>","<2nd_admin_tag>","etc"]
Package: django-log-to-telegram
======================
Django Log to TelegramThis is a simple logger that sends 500 exceptions to a Telegram bot of your choice.Quick startInstall django-log-to-telegram:.. code:: bashpip install django_log_to_telegramregister a bot on Telegram (with BotFather <https://core.telegram.org/bots#6-botfather>_), start a chat with it and put
the Api token in settings.py:.. code:: pythonLOG_TO_TELEGRAM_BOT_TOKEN = '12345678:replace-me-with-real-token'Different errors will be fired if the BOT_TOKEN is not active or if there is no chat active with it.add the 'django_log_to_telegram' to your INSTALLED_APPS setting:.. code:: pythonINSTALLED_APPS = [
    ...
    'django_log_to_telegram',
    ...
]add thedjango_log_to_telegram.log.AdminTelegramHandlerto your app's logging configuration, for example:.. code:: pythonLOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'telegram_log': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django_log_to_telegram.log.AdminTelegramHandler',
            'bot_token': LOG_TO_TELEGRAM_BOT_TOKEN,
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['telegram_log'],
            'level': 'ERROR',
            'propagate': True,
        },
    },
}if you want to test this logger in a debug environment, just remove thefilters': ['require_debug_false'],line in the
'handlers' dictionary.Runpython manage.py migrateto create the django_log_to_telegram models.If everything went well, you bot will then begin sending messages on 500 exceptions.There is avery basictest app provided in the folder test_app. It is configured to send errors to telegram even with
DEBUG active, so that it can be useful with just a.. code:: python./manage.py runserverIt does not provide any database configuration, and most of Django basic settings are stripped out, so any use of it
outside the very basic testing of the django_log_to_telegram mechanism is deprecated to say the least.
Package: django-loguru
Django LoguruThe extension was based on another one and added some extra flavours.
One of the biggest problems with the apps is the logging and that can be messy sometimes.Since this serves as a middleware, it only depends on django (including django rest framework).Documentation:https://tarsil.github.io/django-loguru/Table of ContentsRequirementsInstallationSettingsLicenseRequirementsPython >= 3.7Django>= 3.1Installationpip install django-loguruAdddjango_logurutoINSTALLED_APPSsettings.INSTALLED_APPS=[...'django_loguru']AddDJANGO_LOGURU_MIDDLEWAREto your settings.DJANGO_LOGGING_MIDDLEWARE={'DEFAULT_FORMAT':True,'MESSAGE_FORMAT':"<b><green>{time}</green> <cyan>{message}</cyan></b>",'LOG_USER':False}Adddjango_loguru.middleware.DjangoLoguruMiddlewareas the very last in the list ofMIDDLEWARE.The logs should be now activated for every request/response of you application.If you desire to override what is shown on the screen.fromdjango_loguru.middlewareimportDjangoLoguruMiddlewareclassMyCustomMiddleware(DjangoLoguruMiddleware):def__call__(self,request):"""Code to be executed on every request/response call."""logger.info(f"URL:{request.get_raw_uri()}")logger.info(f"Method:{request.method}")......SettingsDEFAULT_FORMAT- DefaultTrueand it will use the defaultMESSAGE_FORMAT.MESSAGE_FORMAT- Sets the format of the log messages. Defaults to<b><green>{time}</green> <blue>{message}</blue></b>. More information about
your options onlogurudocs.LOG_POST- Default toFalseand it won't show POST data.LOG_PUT- Default toFalseand it won't show PUT data.LOG_PATCH- Default toFalseand it won't show PATCH data.LOG_DELETE- Default toFalseand it won't show DELETE data.LOG_USER- Default toTrueand tells which user did the request/response.LicenseMIT-License