Saravanan666/pypi-org huggingface dataset:
Package: django-statictemplate
This project aims at providing a compromise between dynamic error pages for
Django (that use template tags etc and therefore potentially error too) and
having to write static error pages by hand.It does so by providing a management command that can be invoked to turn a
dynamic Django template into a static HTML page with no template tags
whatsoever in it.Note that this means that every time you change your error pages, you need to
re-run this script. Ideally this is part of your deploy process.Installationpip installdjango-statictemplateinside your virtualenv.Addstatictemplateto yourINSTALLED_APPS.Configurationdjango-statictemplatedoes not require any configuration. by default.By defaultdjango-statictemplateoverrides the configured middlewares for
enhanced compatibility and to avoid incompatibilities.However this may not be always feasible: if you need a specific set of
middlewares to be loaded set:STATICTEMPLATE_OVERRIDE_MIDDLEWARE = Falsein you settings files.Please note thatdjango-statictemplatehas not been tested with every
possible middleware, thus you may encounter failures and strange behaviors
especially fi you use middlewares that changes the response type.Usagepython manage.py statictemplate dynamic_500.html > 500.htmlorpython manage.py statictemplate dynamic_500.html-f500.htmlThe management command renders a template given by name (standard Django
template name resolution applies) and writes the output to stdout or to a file.Argumentstemplate: standard django template name to renderlanguage: sets the client django_language cookie to render page in the
given languageextra_request: extra parameters injected in the request. Parameters must
be serialized in querystring format (e.g.:'variable=value&variable=value';
please note the single quote‘to protect ampersand&).Options-f,--file: file destionation for command outputLicenseThis project is licensed under the BSD license.ContributorsSeehttps://github.com/ojii/django-statictemplate/contributors
Package: django-static-templates
django-static-templatesprovides a management command to render Django templats
as static files. Example usage might be static error pages to delivered by your reverse proxy
if the Django applications dies.FeaturesManagement commandrender_static_templatesto create static files in your STATIC_ROOT.Helpers to render templates as static filesRequirementsdjango-static-templates supports Python 3 only and requires at least Django 1.11.Prepare for developmentA Python 3.6 interpreter is required in addition to pipenv.$pipenvinstall--python3.6--dev$pipenvshell$pipinstall-e.Now you’re ready to run the tests:$pipenvrunpy.testResourcesDocumentationBug TrackerCode
Package: django-statistic
django-statistic=========================Statistic for modelsInstall-------For install you can use pip:```pip install django-statistic```Usage-------models.py```from django.db import modelsclass Authors(models.Model):first_name = ....last_name = ....class Books(models.Model):title = ....author = models.ManyToManyField(Author)```views.py```from statistic import Statisticfrom models import Authors, Booksdef my_view(request):book = Books.objects.get(...)# Put object in statistic tableStatistic.objects.add(book)# Get statistic for objectstatistic_for_object = Statistic.objects.get_statistic_for_object(book)# Get statistic for modelstatistic_for_model = Statistic.objects.get_statistic_for_model(Books, limit=50)# Get statistic for modelsstatistic_for_models = Statistic.objects.get_statistic_for_model([Authors, Books], limit=50, shuffle=True)```settings.py```RELATIVE_FOR_YEAR = 1 # Get relative year (Today is 2013, example get: 2012, 2013)RELATIVE_FOR_MONTH = 3 # Get relative month (Today is 1'th January, example get: 2012.11, 2012.12, 2013.1)RELATIVE_FOR_WEEK = 2 # Get relative week (Today is 13'th week of year, example get: 11, 12, 13 week of year)```Note-------For big data, you must use cache/crontab.
Package: django-statsd
Introductiondjango_statsdis a middleware that usespython-statsdto log query
and view durations to statsd.Documentationhttp://django-stats.readthedocs.org/en/latest/Sourcehttps://github.com/WoLpH/django-statsdBug reportshttps://github.com/WoLpH/django-statsd/issuesPackage homepagehttps://pypi.python.org/pypi/django-statsdPython Statsdhttps://github.com/WoLpH/python-statsdGraphitehttp://graphite.wikidot.comStatsdcode:https://github.com/etsy/statsdblog post:http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/InstallTo install simply executepython setup.py install.
If you want to run the tests first, runpython setup.py testUsageTo install, add the following to yoursettings.py:django_statsdto theINSTALLED_APPSsetting.django_statsd.middleware.StatsdMiddlewareto thetopof yourMIDDLEWARE_CLASSESdjango_statsd.middleware.StatsdMiddlewareTimerto thebottomof yourMIDDLEWARE_CLASSESConfigurationYou can configuredjango-statsdusing the Django settings config:>>> # Settings
... STATSD_HOST = '127.0.0.1'
... STATSD_PORT = 12345The full list of configurations is available inReadTheDocs.Advanced Usage>>> def some_view(request):
...     with request.timings('something_to_time'):
...         # do something here
...         pass
>>>
>>> def some_view(request):
...     request.timings.start('something_to_time')
...     # do something here
...     request.timings.stop('something_to_time')
Package: django-statsd-patches
These patches are designed to be used withdjango-statsd-mozilla.InstallationFrom pypi:pip install django-statsd-patchesThis should install the requirement ofdjango-statsd-mozilla, but if not,
you can install that with:pip install django-statsd-mozillaUsageThe monkeypatches need to be installed to work. To get them installed,
add the following to yoursettings.py:STATSD_PATCHES = [
    'django_statsd_patches.patches.template',
    'django_statsd_patches.patches.redis_timing',
]By default both thetemplateandredis_timingpatches sample every
call. To add sampling to the calls, define one or both of the following
settings in yoursettings.py:STATSD_REDIS_SAMPLE_RATE = 0.5
STATSD_TEMPLATE_SAMPLE_RATE = 0.25Then you’ll get sampling of the calls.Changes0.0.3:Updated setup.py0.0.2:AddedSTATSD_REDIS_SAMPLE_RATEandSTATSD_TEMPLATE_SAMPLE_RATEChanged redis statsd keys0.0.1:First versionLicenseUses theMITlicense.
Package: django-statsd-prom-exporter
django-statsd-prom-exporterA collection of django middleware to track django + WSGI service metrics accurately viaprom/statsd-exporter(as sidecar / dedicated-instance) +prometheusFeaturesStatsdCountMetricMiddleware - Request Count & Request Exception Count metricsStatsdLatencyMetricMiddleware - Request Latency metricsStatsdLogger - Log a custom metricInstallationpip install -U django-statsd-prom-exporterConfigurationTo configure django-statsd, you need to add below configuration to django settings# settings.pySTATSD_IGNORED_IPS=['127.0.0.1']# optional - ignore metrics from requests from listed ipsSTATSD_REQUEST_META_IP_PRECEDENCE_ORDER=('HTTP_X_ORIGINAL_FORWARDED_FOR','REMOTE_ADDR')# optional - default request meta precedence order for ip address# required | `HOST` and `PORT` must be configured for `default` exporter. Additional exporters are optional, but if configured `HOST` and `PORT` must be specified.STATSD_EXPORTERS={# default exporter | required'default':{'HOST':'localhost',# required'PORT':'9125',# required'SERVICE_NAME':'service-name',# optional - adds a dimension to all your metrics'PREFIX':'service_prefix'# optional - adds prefix to all metrics},# secondary exporter | optional'exporter_1':{'HOST':'statsd.host','PORT':'9125','SERVICE_NAME':'service-name','PREFIX':'service-prefix'},}UsageMiddlewareAdd the following to yoursettings.pyAdddjango_statsd.middleware.StatsdCountMetricMiddlewareto the top of yourMIDDLEWAREto get count metricsAdddjango_statsd.middleware.StatsdLatencyMetricMiddlewareto the top of yourMIDDLEWAREto get latency metricsLoggerUsed to track custom metricsfromdjango_statsd.loggerimportStatsdLoggerlogger=StatsdLogger("exporter_1")# some process ran with errorlogger.incr('process_a_error')# process error resolvedlogger.decr('process_a_error')# log time taken to process a task in buckets (50PC, 90PC, 99PC)logger.distribition('task_identifier',1.2)Default exporter can also be used in the folloing way :fromdjango_statsd.loggerimportstatsd_default_loggerasstatsd_logger# some process ran with errorstatsd_logger.incr('process_a_error')# This is equivalent to...fromdjango_statsd.loggerimportStatsdLoggerstatsd_logger=StatsdLogger("default")Build the packageBuild RequirementsMakePythonInitialise Build EnvironmentOne time initialisationmakeinitBuild and install locallymakedist
makeinstallChangelogPlease find the changelog here:CHANGELOG.mdAuthorsdjango-statsd-prom-exporter-middleware was written byKshitij Nagvekar.
Package: django-stats-middleware
Django Stats MiddlewareDjangois one of the most popular Python web frameworks today.When a Django site seems slow, it's nice to put some real number to to that. TheDjango Debug Toolbaris the go-to middleware solution for diagnosing Django performance among other things, but it is rather large, and slow itself, adding significantly to the load time of your pages. So it's in a bit of catch-22 bind for simple performance overviews.For that reason I wrote this tiny little lightweight piece of middleware that reports at the bottom of every page a single line reporting some basic timing stats.Total Time: The time from the request arriving to the response being delivered.Python Time: Time spent running Python codeDB Time: Time spent waiting on database queriesNumber of Queries: The number of database queries runWhere:​	Python Time + DB Time = Total TimeHere's an example:To use it just put it at the top of your Django Middleware stack:MIDDLEWARE=('django_stats_middleware.StatsMiddleware',...That way Total Time will include the time spent in all other middleware as well as your site code.It includes some minimal CSS and to include that in your site include it as an app (so Django knows to collect static files from it):INSTALLED_APPS+=('django_stats_middleware',)and in your template load the CSS:{% load static %}<linkrel="stylesheet"type="text/css"href="{% static 'django-stats-middleware/css/default.css' %}"/>
Package: django-stats-redis
Manage stats within Redis for Django modelsQuickstartInstall stats:pip install django-stats-redisAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'stats',...)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: django-statusboard-notify
statusboard-notifyUtility fordjango-statusboardthat notifies users about service status
changes. The notification are sent via email or published in a Telegram channel.This app periodically notifies about service status changes - except for
changes from "Operational" to "Performance issues" (and viceversa).Notethe notification script attempts to send the messageonly once for
each backend.InstallationInstall the package:pipinstalldjango-statusboard-notify[with_telegram]If you don't need Telegram notifications, you can install the package without
thewith_telegramextra.Configure the applicationAdd the following applications to your Django projects:# settings.pyINSTALLED_APPS+=['statusboard','statusboard-notify',]Email notificationIn order to enable the email notifications, you have to set the sender:# settings.pySTATUSBOARD_NOTIFY_EMAIL_SENDER="statusboard@localhost.localdomainYou can edit the subject:# settings.pySTATUSBOARD_NOTIFY_EMAIL_SUBJECT="Mysubject"You can add a list of recipients that will receive the notifications about all
the services:# settings.pySTATUSBOARD_NOTIFY_EMAIL_RECIPIENTS=["admin@localhost.localdomain","anotheradmin@localhost.localdomain",]From the admin page you can associate an existing user to one or more services:The email is sent in two formats: plain text and html. The email is created
using the templatestatusboard_notify/templates/statusboard_notify/email.htmland then is converted usingpypandocto create the plain text version.It's possibile to customize the footer of the email: create the filetemplates/statusboard_notify/email.htmlthat extends the original template:{% extends "statusboard_notify/email.html" %}
{% block footer %}
    <footer class="footer">
        For more informations please visit <a href="https://localhost.localdomain/status">the statuspage</a>
    </footer>
{% endblock %}Telegram notificationIn order to enable the Telegram notifications, you have to:Create a bot withBotFather.Create a channel.Make your bot an admin of your channel.Go tohttps://web.telegram.organd open the channel: the URL is something
likehttps://web.telegram.org/#/im?p=c1234567890_1231231231231231231.
The channel id is the concatenation of-100and the numbers betweencand_(in the example,1234567890, then the chat id is-1001234567890).Then add the following variables to yoursettings.py.# settings.pySTATUSBOARD_NOTIFY_TELEGRAM_TOKEN="TELEGRAM-TOKEN-FROM-BOTFATHER"STATUSBOARD_NOTIFY_TELEGRAM_CHAT_ID=-1001234567890Configure the notification scriptThe notifications are fired by commandsend_notifications, that reads the
notification queue from the DB and sends the services status changes to the
recipients (the notifications are then removed).You can activate the command usingcrontab,systemd,celery, etc. Below,
an example withcrontab:# Check every 10 minutes for service status changes
*/10 * * * * /path/to/django/project/manage.py send_notificationsContact and copyright informationCopyright (C) 2021 Emanuele Di Giacomoemanuele@digiacomo.ccdjango-statusboard-notify is licensed under GPLv2+.
Package: django-statuspage
=============================django-statuspage=============================.. image:: https://badge.fury.io/py/django-statuspage.png:target: https://badge.fury.io/py/django-statuspage.. image:: https://travis-ci.org/marguslaak/django-statuspage.png?branch=master:target: https://travis-ci.org/marguslaak/django-statuspageDisplay status and information of the system. Can be used as a heartbeatindicator for load balancer.Quickstart----------Install django-statuspage::pip install django-statuspageThen use it in a project::import djstatuspageFeatures--------* Display information about installed system with a simple json responseUsage-----Add url in your project withimport djastatuspageurlpatterns += patterns('',url(r'^', include(djstatuspage.urls.urlpatterns, namespace='statuspage')),)Settings--------*  STATUSPAGE_TASKS - define extra callables to add to output in key-valuemanner. For example.STATUSPAGE_TASKS["version"] = lambda: "0.1.0"Will return{"database": "ok", "version": "0.1.0"}*  STATUSPAGE_TRY_DATABASE - Default True. Turn off database round trip.Cookiecutter Tools Used in Making This Package----------------------------------------------*  cookiecutter*  cookiecutter-djangopackageHistory-------0.1.0 (2015-09-22)++++++++++++++++++* First release on PyPI.
Package: django-status-signal
django-status-signalenhanced django signal which enable you to trigger a signal only if the model instance is in a certain statusInstallpip3 install django-status-signalUsageIn many scenarios, you may want to trigger a function only when a model's status has been changed to a certain status. But the default django's signal can only use the sender(an model instance) to search the receivers. Here comes the solution.from django_status_signal import Signal
class Task(models.Model):
    status = models.CharField(
        choices=(
            ("start", "start"),
            ("doing", "doing"),
            ("success", "success"),
            ("fail", "fail"),
        ),
        max_length=31,
    )
# create a signal and connect it to different status
mysignal = Singal()
mysignal.connect(send_message, Task, dispatch_status="fail")
mysignal.connect(reward, Task, dispatch_status="success")
# call the signal
task = Task.objects.create('start')
mysignal.send(Task, instance=task, task.status)  # nothing will happen
task.status = 'success'
task.save()
mysignal.send(Task, instance=task, task.status)  # the send_message will be calledTODOwhen this project is stable enough, I want to merge the code intodjangoproject, so all thepost_save,post_deletecan acceptdispatch_statusparameter.LICENSEthere are many code copied from thedjangoproject, so the LICENSE should stay the same as django's LICENSE.
Package: django-stdfile
OverviewThis django application simply adds two new fields,RemovableFileFieldandRemovableImageField.
This are the same that the original FileField and ImageField, but it will allowInstallationTo install this application:easy_install django-stdfileInclude'stdfile'insettings.INSTALLED_APPS,ExamplesTo use it, you just::from stdfile.db import RemovableFileField, RemovableImageFieldclass FooModel(model.Model):some_file = RemovableFileField(name=’Some file’)
some_image = RemovableImageField(name=’Some image’)
Package: django-stdnumfield
version: 0.2.0What's an stdnum?Seepython-stdnumUsage:from stdnumfield.models import StdNumField


class SomeMode(models.Model):
    field = StdNumField(
        'hr.oib',  # stdnum format
    )


class SampleModelForm(ModelForm):
    class Meta:
        model = SomeModel
        fields = ('field',)
        error_messages = {
            'field': {
                'stdnum_format':_("Not maching format %(format_list)s"),  # you can override exception message
            },
        }Local development and testingThere is a gazillion ways of managing Python versions these days. I prefer
pip andpyenv:pyenvinstall--skip-existing3.7.4
pyenvinstall--skip-existing3.6.9
pyenvinstall--skip-existing3.5.7
pyenvinstall--skip-existing2.7.16
pyenvvirtualenv3.7.4django-stdnumfieldecho'django-stdnumfield:2.7.16:3.6.9:3.5.7'>.python-version
pipinstall-e.[dev]Run the test project with:cdtestproject
./manage.pymigrate
./manage.pyrunserverThen navigate to:http://localhost:8000/sample_form/http://localhost:8000/model_form/A valid number to test with:12345678903
Package: django-steam
# django-steamSteam api and authentication for django## Installation```pip install django_steam```## ConfigurationFirst install the required apps and set the required settings :```INSTALLED_APPS = (...'django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django_openid_auth','django_steam_api','django_steam',...)AUTHENTICATION_BACKENDS = (...'django_openid_auth.auth.OpenIDBackend',...)LOGIN_URL = '/path/to/openid/login/'OPENID_CREATE_USERS = TrueSTEAM_API_KEY = 'YOURSTEAMAPIKEY'# recommendedOPENID_SSO_SERVER_URL = 'http://steamcommunity.com/openid'SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'# optionalOPENID_UPDATE_DETAILS_FROM_SREG = TrueALLOWED_EXTERNAL_OPENID_REDIRECT_DOMAINS = ['http://example.org']OPENID_STRICT_USERNAMES = False# see https://github.com/edx/django-openid-auth# and https://github.com/voblivion/django-steam-api```Add openid urls to your configuration :```urlpatterns = patterns('',...(r'^openid/', include('django_openid_auth.urls')),...)```Then update database scheme  :```./manage.py migrate```## UsageUse any of django-steam-api models.Give your users link to steam auth :```<a href="/openid/login"><img src="https://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_01.png" width="180" height="35" border="0"></a>```Access steam's player profile of authenticated users :```if user.steam:do_something_with(user.steam.player)```
Package: django-steam-api
# django-steam-apiSteam api models for django## Installation```pip install django_steam_api```## ConfigurationFirst install the app and set your Steam API key :```INSTALLED_APPS = (//...'django_steam_api',//...)STEAM_API_KEY = 'YOURSTEAMAPIKEY'```Then update database scheme  :```./manage.py migrate```## UsageImport models and use custom objects methods to populate the databse.Currently :```Player.objects.steam_create(id)```
Package: django-steamauth
django-steamauthmake steam openid authorization easilyDependencyrequestsDjango >= 1.7InstallPython >= 3pipinstalldjango-steamauthPython 2.xpipinstalldjango-steamauth==1.1.1UsageYou should setABSOLUTE_URLinsettings.pyfor redirection after login. default islocalhost# settings.pyABSOLUTE_URL='127.0.0.1:8000'# orABSOLUTE_URL='yourowndomain.com'You can retrive user id withget_uidmethod when a login is successful.# views.pyfromdjango.shortcutsimportredirectfromsteamauthimportauth,get_uid# GET /logindeflogin(request):# if your service does not support ssl, set use_ssl parameters value to False# return auth('/callback', use_ssl=False)returnauth('/callback')# GET /processdeflogin_callback(request):steam_uid=get_uid(request.GET)ifsteam_uidisNone:# login failedreturnredirect('/login_failed')else:# login success# do something with variable `steam_uid`returnredirect('/')Changelog1.1.2Dropping Python 2 SupportRemove deprecated interfaces:RedirectToSteamSignIn,GetSteamID64Change the default value ofABSOLUTE_URLfromlocalhosttolocalhost:8000Fix an issueuse_sslparameter ofauthdidn't work (#6)Set default value ofuse_ssltoTrue
Package: django-sticky-files
An application that solves a problem, when you need to save
form’s file field values between page reloads
(including form validation errors).Currently in development.InstallationInstall an application:pip install django-sticky-filesThen addsticky_filestoINSTALLED_APPS.Include urls:url(r'^sticky-images/', include('sticky_files.urls', namespace='sticky_files')),UsageThere are four model fields that implement sticky files behaviour:from django.db import models
from sticky_files import fields
from sticky_files.models import FileBase


class SomeImage(FileBase):
    pass


class SomeFile(FileBase):
    pass

class SomeModel(models.Model):
    main_image = fields.StickyImageField(
        'app.SomeImage',
        related_name='+'
    )
    images = fields.ManyStickyImageField(
        'app.SomeImage',
        max_objects=4,
        related_name='galleries_images',
    )
    file = fields.StickyFileField(
        'app.SomeFile',
        related_name='+'
    )
    files = fields.ManyStickyFileField(
        'app.SomeFile',
        max_objects=4,
        related_name='galleries_files',
    )It looks like this:Project is in development, so there are no documentation and testsyet.
Package: django-sticky-messages
=====Sticky Messages=====Sticky Messages is a simple Django app to display "sticky" messages stored ina message model that expire after a given time period.Inspiration from:http://stackoverflow.com/questions/3076365/how-to-make-django-messages-stackoverflow-styleDetailed documentation is in the "docs" directory.Quick start-----------1. Add "stickymessages" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'stickymessages',)2. Add "stickymessages" to your TEMPLATE_CONTEXT_PROCESSORS setting like this::TEMPLATE_CONTEXT_PROCESSORS = (...'stickymessages.context_processors.latest_sticky_message',)3. Run `python manage.py syncdb` to create the stickymessages models.4. Start the development server and visit http://127.0.0.1:8000/admin/to create a message (you'll need the Admin app enabled).5. To display a message simply add{% include "stickymessages/display_latest_message.html" %} to one of yourtemplates.NOTE: Template file uses bootstrap 'alert alert-block' classes for styling.You may create your own styling by using the sticky-message style.