Saravanan666/pypi-org huggingface dataset:
Package: django-reports-admin
django-reports-adminA Django Admin add-on which adds functionality to export data in
customized forms of output.RequirementsDjango Reports Admin requiresDjango 1.10or later, and is written
forPython 3.5or later.InstallationNOTE:Although enabled by default, you’ll want to ensure thatdjango.contrib.contenttypesis withinINSTALLED_APPS.pipinstalldjango-reports-adminThen, amend your Djangosettings.INSTALLED_APPS:INSTALLED_APPS=(...'reports',...)UsageCreating reports requires subclassing theModelReportclass and
identifying a report. This can be done with a few lines of code if you
simply want to extract the admin list view for verbatim. For example:# This file can be named anything, but it lives well within the admin.py or# models.py as it'll ensure your register() command is run.# yourapp/reports.py -- This file can be named anythingfromreports.baseimportModelReportclassMyReport(ModelReport)name="Report - My Report"Then, register theModelReportagainst a model:# yourapp/admin.pyfrom.reportsimportMyReportfrom.modelsimportMyModelreports.register(MyModel,MyReport)Upon registration, you’ll see a new action with the Django Admin for
that Model, with whatever name you’ve provided in thenameattribute.For advanced report modification, subclass the following functions
within yourModelReportclass:get_field_lookupsreturns a list of column name-value/callback
tuples. This function is a great way to modify the columns of the
report, and the exact output of each field. It is useful if you wish to
create a calculated field, or format a date field.get_row_datareturns a dictionary of the data to be entered for each
row. Generally you should not need to modify this asget_field_lookupswill be sufficient.generate_outputcan be modified to adjust the type of output. By
default, a CSV file is generated.Usage In Shell And TestsIt may be useful for you to test a report via code, either as a test or
a quick shell script. This is done without much stress:# Assuming a defined ModelReportfromreports.baseimportModelReportfrom.modelsimportMyModelclassMyReport(ModelReport):queryset=MyModel.objects.all()# Instantiate the report, and run it through various meansreport=MyReport()# Create a SavedReport instancereport.run_report()# Raw output of the report (as CSV, by default)report.generate_output()# Output list of OrderedDictsreport.collect_data()TestingTests are run usingpytest, and the test suite can be executed using
the MakeFilemaketestChangelog1.1.0 (2021-02-06)58bece6- Migration for change toSavedReport.run_byfae699c- Full code base format + commit of change toSavedReport.run_by.
Modified to add theon_delete=models.SET_NULL1.0.4 (2017-02-28)a0dc5a0- ReturnNoneon error when callingModelReport1.0.3 (2017-02-27)21ca6a5- Refactor calling to report runnerfba6bf1- Allow queryset to be passed within __init__ method5f0ef05- Add simple test case for ModelReport, refine misc.3d7d587- Document shell usage in README, add more type hints5268739- Adjust signature of run_report, easing usage in shell1.0.2 (2017-02-10)fa46174Adjust user messaging in admin.Update README1.0.1 (2017-02-10)First pypi release1.0.0 (2017-02-09)Initial commit
Package: django-reports-creator
Django Reports Creator===================django-reports-creator is a Django application and library for reports integrated with highcharts.[![Build Status](https://travis-ci.org/bytcode/django-reports-creator.png)](https://travis-ci.org/bytcode/django-reports-creator)--------------------------------------------------------------------Documentation=============https://django-reports-creator.readthedocs.org/en/latest/Contribute==========Clone the repo and help to be better this app :)
Package: django-report-tools
django-report-tools===================Django Report Tools aims to take the pain out of putting charts, graphsand tables into your Django projects. It provides a nice class-basedframework to restore a little bit of elegance to your application'scomplex data views.Features--------* Define your reports using the same syntax as Django forms and models* Use built-in 'renderers' to avoid the hassle of dealing with variouscharting technologies (currently only the Google Visualization Toolkit is supported)* Enter chart data in a standardised format* Build a simple API, allowing for the creation of chart exports or a 'save to dashboard' feature.Release Notes - 0.2.1---------------------* Fixed a JSON encoding bug that broke Python 2.6 compatibility.* Added a tox.ini and setup.py test support so I can test and prevent these sorts ofbug in the future.Release Notes - 0.2-------------------* Updated for Django 1.5 compatibility* Fixed an XSS vector in the Google Charts renderer* Updated to the most recent GViz APIA fully-functional example report-----------------The following example implements a report with a simple pie chart, renderedusing the Google Visualization Toolkit.::from report_tools.reports import Reportfrom report_tools.chart_data import ChartDatafrom report_tools.renderers.googlecharts import GoogleChartsRendererfrom report_tools import chartsclass MyReport(Report):renderer = GoogleChartsRendererpie_chart = charts.PieChart(title="A nice, simple pie chart",width=400,height=300)def get_data_for_pie_chart(self):data = ChartData()data.add_column("Pony Type")data.add_column("Population")data.add_row(["Blue", 20])data.add_row(["Pink", 20])data.add_row(["Magical", 1])return dataRead on in the documentation for a full explanation and lots more examples.Links-----Project Home: http://github.com/evanbrumley/django-report-toolsDocumentation: http://django-report-tools.readthedocs.orgInstallation------------To install django-report-tools simply use: ::$ pip install django-report-toolsOr alternatively: ::$ easy_install django-report-tools
Package: django-repositories
Repositories is a simple Django-based app to manage source code repositories.It is not meant to manage repositories that are only accessed by one person, but for a team of people.It can:Create new repositoriesManage public or private read accessManage user or group authentication and commit accessIt can use these version control systems:SubversionGitMercurial (Not Done: Need help)Bazaar (Not Done: Need help)Others could be written in to the vcs abstractionThe hosting is done through Apache httpd, as there are hooks in Apache httpd’s mod_python and mod_wsgi implementations for external authentication and authorization.
Package: django-request
django-request is a statistics module for django. It stores requests in a
database for admins to see, it can also be used to get statistics on who is
online etc.As well as a site statistics module, with theactive_userstemplate tag and
manager method you can also use django-request to show who is online in a
certain time:Request.objects.active_users(minutes=15)To find the request overview page, please click on Requests inside the admin,
then “Overview” on the top right, next to “add request”.RequirementsPython: 3.6, 3.7, 3.8, 3.9, 3.10, 3.11Django: 2.2, 3.2, 4.0, 4.1, 4.2python-dateutildjango-request1.5.1is the last version that supports Django 1.4, 1.5, 1.6.django-request1.5.4is the last version that supports Django 1.7, 1.8, 1.9.django-request1.5.5is the last version that supports Django 1.10.django-request1.5.6is the last version that supports Django 1.11, 2.0, 2.1,
3.0, 3.1, and Python 2.7 and 3.4.InstallationPut'request'in yourINSTALLED_APPSsetting.Run the commandmanage.py migrate.Addrequest.middleware.RequestMiddlewaretoMIDDLEWARE. If you usedjango.contrib.auth.middleware.AuthenticationMiddleware, place theRequestMiddlewareafter it. If you usedjango.contrib.flatpages.middleware.FlatpageFallbackMiddlewareplacerequest.middleware.RequestMiddlewarebefore it else flatpages will be
marked as error pages in the admin panel.AddREQUEST_BASE_URLto your settings with the base URL of your site
(e.g.https://www.my.site/). This is used to calculate unique visitors
and top referrers.REQUEST_BASE_URLdefaults to'http://%s'%Site.objects.get_current().domain.Detailed documentationFor a detailed documentation of django-request, or how to install
django-request please see:django-requestor the docs/ directory.
Package: django-request-cache
Django Request Cache provides a cache for each request (within your Django Request/Response cycle).Quick startDownload and install usingpip installpipinstalldjango-request-cacheAddUserForeignKeyMiddlewareandRequestCacheMiddlewareto yourMIDDLEWAREsettings like this:MIDDLEWARE=(...'django.contrib.auth.middleware.AuthenticationMiddleware',...'django_userforeignkey.middleware.UserForeignKeyMiddleware','django_request_cache.middleware.RequestCacheMiddleware',)or if you are still using the an older Django version (e.g., Django 1.8) withMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES=(...'django.contrib.auth.middleware.AuthenticationMiddleware',...'django_userforeignkey.middleware.UserForeignKeyMiddleware','django_request_cache.middleware.RequestCacheMiddleware',)Use the per-request cache as a decoratorfromdjango_request_cacheimportcache_for_request@cache_for_requestdefdo_some_complex_calculation(a,b,c):print("Calculating... please wait")returna*b*cTry it out by executing do_some_complex_calculation multiple times within your requestAttributionRequestCacheandRequestCacheMiddleware(seemiddleware.py) are from a source code snippet on StackOverflowhttps://stackoverflow.com/questions/3151469/per-request-cache-in-django/37015573#37015573created by coredumperrorhttps://stackoverflow.com/users/464318/coredumperrorOriginal Question was posted byhttps://stackoverflow.com/users/7679/chase-seibertathttps://stackoverflow.com/questions/3151469/per-request-cache-in-djangocopied on 2017-Dec-20
Package: django-request-context
django-request-contextDjango middleware which provide request and g object.
all of which are accessible everywhere, and thread isolation, just like used in flask.InstallingInstall and update using pip:pip install django-request-contextUsageAdd RequestContextMiddleware to MIDDLEWARE in settings.pyimport django_request_context

MIDDLEWARE = [
   ...
   'django_request_context.RequestContextMiddleware',
   ...
   ]You can get request and g objects anywhere in the project throughout the life cycle of the request.
just import:from django_request_context import request, gwhy do you need this?when your django project is big enough and the function call stack is deep.
if your want to get request object in the bottom of the call stack,
you need to transfer request as parameters layer-by-layer, this can help you get request directly.
the request you import from django-request-context isreadonlyobject,
if your want to convey some message you can user g object, this is awriteableobject.
the behavior of the request and g objects is exactly the same as in the flask.
Package: django-request-hook
Django Request HookDjango middlewares to track request/response logs. Catch the logs and send it to anywhere you want through HTTP.InstallationYou can install the Django Request Hook fromPyPIHow to usePyPIpip install django-request-hookAdd in MIDDLEWAREMIDDLEWARE = [
    ...,
    'django_request_hook.middleware.LogTracker'
]SettingsREQUEST_HOOK_EXCLUDES = []

REQUEST_HOOK_LOG_URL = 'https://xxx/api/log'

REQUEST_HOOK_LOG_TOKEN = 'mytoken'
Package: django-request-id
Augments each request with uniquerequest_idattribute and provides
request id logging helpers.Developed and used aten.ig.ma software shop.QuickstartIncludedjango-request-idin yourrequirements.txtfile.Addrequest_idtoINSTALLED_APPS(necessary only if you are
going to use the{% request_id %}template tag).Addrequest_id.middleware.RequestIdMiddlewareat the top of
theMIDDLEWAREDjango setting.The app integrates with the standard Python/Django logging by defining
a filter that puts arequest_idvariable in scope of every log message.First add a filter definition to the DjangoLOGGINGsettings:"filters":{"request_id":{"()":"request_id.logging.RequestIdFilter"}}Then enable the filter for related handlers:"handlers":{"console":{..."filters":["request_id"],}}And finally modify formatter output format to include the%(request_id)placeholder:"formatters":{"console":{"format":"%(asctime)s-%(levelname)-5s[%(name)s] request_id=%(request_id)s%(message)s"}}A full Django logging config example may look like this:LOGGING={"version":1,"disable_existing_loggers":False,"filters":{"request_id":{"()":"request_id.logging.RequestIdFilter"}},"formatters":{"console":{"format":"%(asctime)s-%(levelname)-5s[%(name)s] request_id=%(request_id)s%(message)s","datefmt":"%H:%M:%S"}},"handlers":{"console":{"level":"DEBUG","filters":["request_id"],"class":"logging.StreamHandler","formatter":"console"}},"loggers":{"":{"level":"DEBUG","handlers":["console"]}}}Make sure that your web server adds aX-Request-IDheader to each request
(and logs it in the server log for further matching of the server and app log entries).Heroku handles thisautomatically.On Nginx you may require a separate module (seenginx_requestidornginx-x-rid-header).On Apache you need toa2enmodtheunique_idmodule and setREQUEST_ID_HEADER = "UNIQUE_ID"in the Django project
settings.If you can’t generate theX-Request-Idheader at the web server level then
simply setREQUEST_ID_HEADER = Nonein your project settings and the
app will generate a unique id value automatically instead of retrieving
it from the wsgi environment.For more info on server configs seeserver-config.DependenciesNone.Documentation and demoThe full documentation is athttp://django-request-id.rtfd.org.There’s also an instant demo example that can be run from the cloned repository:python demo.pySee the integration in action on Heroku:Licensedjango-request-idis released under the MIT license.Other ResourcesGitHub repository -https://github.com/nigma/django-request-idPyPi Package site -http://pypi.python.org/pypi/django-request-idCommercial SupportThis app and many other help us build better software
and focus on delivering quality projects faster.
We would love to help you with your next project so get in touch
by dropping an email aten@ig.ma.History1.0.0 (2016-10-23)Django 1.10 compatibility0.1.0 (2014-01-30)First release
Package: django-requesting-os-analyzer
to install run the commandpip install django-requesting-os-analyzeradd to your installed appsINSTALLED_APPS = [
        ...,
        'django_requesting_os_analyzer.apps.DjangoRequestingOsAnalyzerConfig',
    ]add middlewareMIDDLEWARE = [
        ...,
        'django_requesting_os_analyzer.middleware.CounterMiddleware',
    ]and then to allow the graph to show up you have to tweak your templates settings,
make sure 'APP_DIRS' is set to True.TEMPLATES = [
    {
        ...,
        'DIRS': ['templates'],
        'APP_DIRS': True,
    },
]you can also change the color of the graph's bar and their border by defing followingREQUEST_ANALYZER_BG_COLOR = (255,255,255,0.2)
REQUEST_ANALYZER_CHART_COLOR = (255,0,0,0.2)
Package: django-requestlog
Django-RequestlogMiddleware who logs each request with their headers and the body into to PostgreSQL for diagnostic purposes.Why Logging to the database?Logging to the database instead of to a logfile has the advantage that it can be
searched by people not having access to the server logs. Of course this only works
for low traffic sites. And I recommend to purge those logs regularly with the provided
manage command or celery task.What is logged?The log is written to the tablerequestlog_requestlog.timestampclient IP addressdjango user-idmethodURLheader fieldscookiesquery parameterPOST bodyHTTP status codethe first 1024 of the responseCreditsBased onhttps://github.com/ASKBOT/django-request-loggingSettingsRequest logging has to be explicitely enabled (for performance reasons):REQUEST_LOGGING_ENABLED = TrueYou can ask the service to ignore certain fields from the querystring and the header. You do this by setting
the name of the fields in the Django settings variableREQUEST_LOGGING_HIDE_PARAMETERS. For example like this:REQUEST_LOGGING_HIDE_PARAMETERS = [ 'HTTP_AUTHORIZATION', 'password' ]Filter certain IPs (e.g. internal Kubernetes health check requests)REQUEST_LOGGING_IGNORE_IPS = [ '10.2.3.4' ]Filter certain paths by Regex (including query string):REQUEST_LOGGING_IGNORE_PATHS = [ '/admin/login' ]Purge old entriesYou can use the following management command which deletes entries older than 3 days:./manage.py requestlog_purgeOr you trigger the task with Celery beat by adding a shared task to your projects task list:In your settings:CELERY_BEAT_SCHEDULE = {
    ...    
    'requestlog.tasks.delete_old_requestlog_entries': {
        'task': 'requestlog.tasks.delete_old_requestlog_entries',
        'schedule': crontab(hour=2, minute=0)
        'args': (30,) # This is the number of days to keep the entries 
    },
}
Package: django-request-log
django-request-logdjango-request-log is pluggable Django application to keep track user login and logout events and URLs views
developed at ORCAS.QuickstartInstallationdjango-request-log is available on PyPI, so you can install it withpip:$ pip install django-request-logOr adddjango-request-logto the project’s requirement fileUsageAddlogto yourINSTALLED_APPS.Addlog.middleware.RequestLoggingMiddlewareto yourMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    ...
    'log.middleware.RequestLoggingMiddleware',
)Run:$ python manage.py syncdbTODOs and BUGSSee:https://github.com/orcasgit/django-request-log/issues
Package: django-request-logger-2
# Django Request LogSimple Django model for logging HttpRequest instances.## Why?We have a number of libraries that store elements of a request (path,querystring, user, response code, remote_addr, and so on), and it seemedlike time to create a single model that we can use in all of them,storing a common set of values.This is not a replacement for web server logs - it's a utility for usein specific situations where you want to accurately log that someonerequested something.## How it worksThere is a single model, `RequestLog` and a model manager with a`create` method that can take in a standard `HttpRequest` and / or`HttpResponse` object and create a new `RequestLog` object. If youare using this to record view functions, there is also a decorator,`log_request` that will take care of all this for you:```pythonfrom request_logger.decorators import log_request@log_request("downloads")def download(request: HttpRequest) -> HttpReponse:return HttpResponse("OK")@log_request(lambda r: r.user.get_full_name())def download(request: HttpRequest) -> HttpReponse:return HttpResponse("OK")```The `log_request` argument is mandatory and is used as a "reference",or category classifier. It can be a str, or a callable which takesin the request as a single arg.## Screenshots**Admin list view**<img src="screenshots/admin-list.png">**Admin item view**<img src="screenshots/admin-edit.png">
Package: django-requestlogging
This package provides a logging filter and middleware to add
information about the current request to the logging record.Installation and UsageInstall the package, adddjango_requestloggingtosettings.INSTALLED_APPS, adddjango_requestlogging.middleware.LogSetupMiddlewaretosettings.MIDDLEWARE_CLASSES, and adddjango_requestlogging.logging_filters.RequestFilteras a logging
filter.  See below for an example logging configuration.The filter adds information about the current request to the logging
record.  The following keys can be substituted in the logging
formatter string:http_user_agentThe user agent string, provided by the client.path_infoThe requested HTTP path.remote_addrThe remote IP address.request_methodThe HTTP request method (e.g.GET, POST, PUT, DELETE,etc.)server_protocolThe server protocol (e.g.HTTP, HTTPS,etc.)usernameThe username for the logged-in user.If any of this information cannot be extracted from the current
request (or there is no current request), a hyphen'-'is
substituted as a placeholder.Logging Configuration ExampleThis logging configuration can be added to yourDJANGO_SETTINGS_MODULE.  It adds an unbound RequestFilter,
which will be bound to the current request by the middleware and then
unbound again at response time.LOGGING = {
    'filters': {
        # Add an unbound RequestFilter.
        'request': {
            '()': 'django_requestlogging.logging_filters.RequestFilter',
        },
    },
    'formatters': {
        'request_format': {
            'format': '%(remote_addr)s %(username)s "%(request_method)s '
            '%(path_info)s %(server_protocol)s" %(http_user_agent)s '
            '%(message)s %(asctime)s',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['request'],
            'formatter': 'request_format',
        },
    },
    'loggers': {
        'myapp': {
            # Add your handlers that have the unbound request filter
            'handlers': ['console'],
            # Optionally, add the unbound request filter to your
            # application.
            'filters': ['request'],
        },
    },
}
Package: django-requestlogging-redux
This package provides a logging filter and middleware to add
information about the current request to the logging record.Installation and UsageInstall the package, adddjango_requestloggingtosettings.INSTALLED_APPS, adddjango_requestlogging.middleware.LogSetupMiddlewaretosettings.MIDDLEWARE_CLASSES, and adddjango_requestlogging.logging_filters.RequestFilteras a logging
filter.  See below for an example logging configuration.The filter adds information about the current request to the logging
record.  The following keys can be substituted in the logging
formatter string:http_user_agentThe user agent string, provided by the client.path_infoThe requested HTTP path.remote_addrThe remote IP address.request_methodThe HTTP request method (e.g.GET, POST, PUT, DELETE,etc.)server_protocolThe server protocol (e.g.HTTP, HTTPS,etc.)usernameThe username for the logged-in user.If any of this information cannot be extracted from the current
request (or there is no current request), a hyphen'-'is
substituted as a placeholder.Logging Configuration ExampleThis logging configuration can be added to yourDJANGO_SETTINGS_MODULE.  It adds an unbound RequestFilter,
which will be bound to the current request by the middleware and then
unbound again at response time.LOGGING = {
    'filters': {
        # Add an unbound RequestFilter.
        'request': {
            '()': 'django_requestlogging.logging_filters.RequestFilter',
        },
    },
    'formatters': {
        'request_format': {
            'format': '%(remote_addr)s %(username)s "%(request_method)s '
            '%(path_info)s %(server_protocol)s" %(http_user_agent)s '
            '%(message)s %(asctime)s',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['request'],
            'formatter': 'request_format',
        },
    },
    'loggers': {
        'myapp': {
            # Add your handlers that have the unbound request filter
            'handlers': ['console'],
            # Optionally, add the unbound request filter to your
            # application.
            'filters': ['request'],
        },
    },
}