Saravanan666/pypi-org huggingface dataset:
Package: dj-static-revision
Django plugin to provide a context variable for retrieving the version of running application.This variable is meant to change the URL of a static file, to invalidate browser cache.Installpip3installdj-static-revisionDjango Static Revisiononly supports Python 3.8+.UsageAdddj_static_revision.context_processors.static_revisionto yourcontext_processorslist.TEMPLATES=({'NAME':'jinja2','BACKEND':'django_jinja.backend.Jinja2','OPTIONS':{'context_processors':(# Other context processors'dj_static_revision.context_processors.static_revision',),A variableREVISIONwill then exists in your template, you can use it to append to static file URL.<script src="{{static('js/app.js')}}?v={{REVISION}}"></script>Django Static Revisionretrieves revision string from Git history.
If your source code is not managed by Git, the revision info will be read from a file named.versionplaced next tomanage.pyfile.SettingsThe revision string will be truncated to 10 characters. You can change that by add to Django settings:STATIC_REVISION_STRING_LENGTH=10You can also change the file forDjango Static Revisionto read revision string from, by add this setting:STATIC_REVISION_VERSION_FILE='.version'where.versionis a text file containing any string you want.
Package: dj-storage
Nice file storage support for DjangoThis is a single, generic file storage backend for Django, for storing the files on any storage service with a HTTP/REST API.BothGoogle StorageandAWS S3provide HTTP/REST API for file storage.The only thing that differs between the services is the authentication method. Both Google and AWS use their own propertiary authentication methods, that have to be implemented.Right now only Google Storage auth is implemented.RequirementsDjango 2.0+Installationpipinstalldj-storagesettings.pySetDEFAULT_FILE_STORAGE = 'dj_storage.HTTPStorage'SetMEDIA_URL = 'https://storage.googleapis.com/your-bucket-name/'ProvideGCP Application Default CredentialsPlanned featuresSupport for AWS S3 auth - requires fixingaws-requests-auth #45Support for standard auth mechanisms (like HTTP Basic auth)
Package: dj-streamio
DJ StreamIOFramework for making it easy to post stream updates to (stream.io)[https://getstream.io]Installationpip install dj-streamioConfiguration1. AddstreamiotoINSTALLED_APPS2. Configure your models for tracking:e.g.:fromstreamio.mixinsimportStreamModelMixinclassTodo(models.Model,StreamModelMixin):collection='todos'feed_name='todo'feed_actor_field='owner_id'feed_once_off_actions=["create"]feed_related_mapping=[# feed_slug, model_field('user','owner_id'),('todo','id'),]# a list of object_id prefixes to look for in the `object_ids` field# e.g.: todo.object_ids = ["foo:1", "bar:2"]feed_object_ids_mapping=["foo","bar"]enrichment_serializer='example_app.models.TodoSerializer'Notes:We addStreamModelMixinto our modelAdd the various meta fieldsProfitTrack actions:todo=Todo.objects.first()todo.track_action('create')todo.track_action('start')todo.track_action('complete')Add reaction:You can add a reaction (e.g.: like, comment, upvote etc) to an activityExampletodo.add_reaction(activity_kind,# e.g.: like, comment, statusactivity_id,data,by=user_id,target_feeds=["notification:thierry"])notes:datais the reaction data. e.g.:{"text": "@thierry great post!"}by(optional) will default to the modelsactor_idif none is provided.target_feeds(optional) will default to the modelsfeed_related_mapping.Stream docs on Reactions:https://getstream.io/docs/python/#reactions_introductionAdd notifications:todo=Todo.objects.first()# note: you'll need to setup a webhook to actually handle forwarding!# https://getstream.io/docs/#realtime-webhooks# a combination of ways to propagate this notification (all are optional)forward={"sms":['+27...','+27...'],"inapp":['user:1','user:2'],# inapp notification channels"email: ['jane@soap.com', 'joe@soap.com']}todo.add_notification(verb="..",notify=[user1.id,user2.id],message='hello!',forward=forward)Get Feedtodo=Todo.objects.first()# get feed with all the defaultstodo.get_feed()# you can set any extra args with kwargs:# available parameters: https://getstream.io/docs/python/#retrievetodo.get_feed({"limit":5,"offset":5,"enrich":False})Feed mixindj-streamioprovides a mixin that can be used to expose a/stream/endpoint on a DjangoRestFrameworkModelViewSet. This endpoint proxiess the group feed for the underlying model. It also provides an analytics endpoint which gives a breakdown of the last 100 activities at/streamactivity/Example:fromstreamio.viewsetsimportStreamViewSetMixin# for older versions of DRF (prior to the @action update) use this mixin# from streamio.viewsets_legacy import StreamViewSetMixin...# then simply mix it into your ViewSet:classTodoViewSet(StreamViewSetMixin,viewsets.ModelViewSet):queryset=Todo.objects.all()serializer_class=TodoSerializer# /todos/:pk/stream/# /todos/:pk/streamactivity/Low level usagefromstreamio.streamioimportget_clientstream=get_client()# returns a standard logged-in stream.io client...Note:See also:StreamObjectandStreamUserTODOS:Provide alternative backends (later)
Package: dj-stripe
dj-stripe - Django + Stripe Made EasyStripe Models for Django.Introductiondj-stripe implements all of the Stripe models, for Django. Set up your
webhook endpoint and start receiving model updates. You will then have
a copy of all the Stripe models available in Django models, as soon as
they are updated!The full documentation is availableon Read the Docs.FeaturesStripe CoreStripe BillingStripe Cards (JS v2) and Sources (JS v3)Payment Methods and Payment Intents (SCA support)Support for multiple accounts and API keysStripe Connect (partial support)Tested with Stripe API2020-08-27(seeAPI versions)RequirementsDjango >=3.2Python >=3.8PostgreSQL engine (recommended) >=9.6MySQL engine: MariaDB >=10.2 or MySQL >=5.7SQLite: Not recommended in production. Version >=3.26 required.InstallationSeeinstallationinstructions.ChangelogSee release notes on Read the Docs.Funding and SupportYou can now become a sponsor to dj-stripe withGitHub Sponsors.We've been bringing dj-stripe to the world for over 10 years and are excited to be able to start
dedicating some real resources to the project.Your sponsorship helps us keep a team of maintainers actively working to improve dj-stripe and
ensure it stays up-to-date with the latest Stripe changes. If you use dj-stripe commercially, we would encourage you to invest in its continued
development bysigning up for a paid plan.
Corporate sponsorsreceive priority support and development time.All contributions through GitHub sponsors flow into ourOpen Collective, which holds our funds and keeps
an open ledger on how donations are spent.Our Gold sponsorsSimilar librariesdj-paypal(PayPal)dj-paddle(Paddle)
Package: djsubdomains
Subdomain helpers for the Django framework, including subdomain-based URL
routing and reversing.Full documentation can be found here:http://djsubdomains.readthedocs.org/Build StatusTested on Python 2.6, 2.7, 3.3 and 3.4, as well as Django 1.5, 1.6, 1.7, and 1.8.Installationpip install djsubdomains
Package: djsuperadmin
DjSuperAdmin✍🏻 Edit contents directly on your page with DjangoHere how it works!InstallationpipinstalldjsuperadminSetupAdddjsuperadminto yourINSTALLED_APPSinsettings.pyINSTALLED_APPS=[# ...'djsuperadmin']And import all the required js files in the footer{% load djsuperadmintag %}

{% djsuperadminjs %}UsageDefine yourcustom Contentmodel usingDjSuperAdminMixinand provide an endpoint to GET/PATCH your contentfromdjango.dbimportmodelsfromdjsuperadmin.mixinsimportDjSuperAdminMixinclassGenericContent(models.Model,DjSuperAdminMixin):identifier=models.CharField(max_length=200,unique=True)content=models.TextField()@propertydefsuperadmin_get_url(self):returnf'/api/content/{self.pk}'@propertydefsuperadmin_patch_url(self):returnf'/api/content/{self.pk}'Then in your template{% load djsuperadmintag %}

...<body><p>{% superadmin_content your_object 'your_object_attribute' %}</p></body>
Package: djsw_wrapper
# djsw_wrapperMissing Swagger and Django tool.[![PyPI version](https://badge.fury.io/py/djsw_wrapper.svg)](https://badge.fury.io/py/djsw_wrapper)## What?Swagger/OpenAPI is an amazing thing. It allows you to describe your schema completely in yaml/json and have a number of backends which allow you to generate code for many frameworks and languages. Unfortunately, there were no options to use Swagger as a schema source if you develop your code using Django/DRF (however, the latter can generate Swagger schema from your current source). Until now!## Requirements`django`, `djangorestframework`, `jinja2`, `flex`## Okay, how do I shoot ~~the web~~ Swagger?* Get this package: `pip install djsw_wrapper`* Modify your django project's `settings.py`:```python...# Application definitionINSTALLED_APPS = ['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','rest_framework','djsw_wrapper', # << add this'stubapp.apps.StubappConfig']# This: full path to schema resource (local file or url, json or yaml)SWAGGER_SCHEMA = '/path/to/swagger/schema'# And this (optional, but recommended):SWAGGER_MODULE = 'swagger_controller_python_module_name'```* Add new url patterns to `urls.py`:```pythonfrom djsw_wrapper.router import SwaggerRouterrouter = SwaggerRouter()urlpatterns = router.get_urls() + [# ^^^^^^^^^^^^^^^^^^^ add thisurl(r'^admin/', admin.site.urls)]```* Basically, you're all set now. However, if you don't have any controllers (`views` in Django's terminology), you can generate code for them (need `SWAGGER_MODULE` setting populated):```shell$ python manage.py makeswaggerviews```* Go!```shell$ python manage.py runserver```## How does it work?#### 1. Schema parsing and route generationIt parses swagger schema and creates url patterns for each path described there. Next, each path is bound to the corresponding view (`controller` in Swagger's terminology). How this bounding happens? Firstly, it tries to import `SWAGGER_MODULE` module, specified in `settings.py`. If there's no such module or setting, stub handlers are autogenerated in runtime. If there is a module, tool looks into `x-swagger-router-controller` property in each path definition; if property is present and points to callable view in aforementioned `SWAGGER_MODULE` module, bounding happens. If not, stub is used.### 2. Request processingWhen request comes to a certain endpoint (`path`)  and there's a suitable handler (`view`) for it, validation and serialization happens automatically. For example, if you specified some `parameter` for a `path` as `required` and it's not present in the request, client will get an error message. The same happens if there's type inconsistency (for example, you specified integer, but client sent string). If all is good, suitable handler (`view`) is executed (or stub handler, if bounding didn't happen).
Package: dj-tables
dj-tablesA template only and DRY solution for creating tables.Specifying how data is displayed should be exclusively done by the template, and this library
aims to do this by providing powerful template tags for constructing complex tables.The full documentation is availableon Read the Docs.InstallationInstall the package usingpip:pip install dj-tablesAdddj_tablesto yourINSTALLED_APPS:INSTALLED_APPS=(# ...'dj_tables',# ...)Basic ExampleWe start with this basic model:classMyModel(Model):my_field=CharField()some_other_field=IntegerField()and this genericListView:classMyListView(ListView):model=MyModeltemplate_name='some_template.html'And creating the table in your template is straightfoward, add a few tableheader tags with the
attributes you want to be rendered.{% load dj_tables %}
{% table object_list %}
    {% tableheader key='my_field' %}
    {% tableheader key='some_other_field' %}
{% endtable %}
Package: dj-tasks
A django app to run a collection of tasks in a management command.DocumentationThe full documentation is athttps://dj-tasks.readthedocs.io.QuickstartInstall dj-tasks:pip install dj-tasksAdd it to yourINSTALLED_APPS:# project/settings.pyINSTALLED_APPS=[...'dj_tasks',...]Create a task:# your_app/tasks.pyfromdj_tasks.tasksimportTaskclassYourTask(Task):name="Your Task"frequency=60defrun(self):print("Your custom code...")Add to yourDJTASKS_TASKSsettings:# project/settings.pyDJTASKS_LOCK_ID="your_django_project"DJTASKS_TASKS=["your_app.tasks.YourTask",]Running TestsDoes the code actually work?$ make install-dev
$ make lint
$ make testCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory2.0.0 (2022-09-25)handle exception when running individual tasksDrop support for django <3.2Add support for django 4.0 and 4.11.1.0 (2020-12-28)add documentation ofDJTASKS_LOCK_IDto Quickstartupdate MakeFile to use current work flowclose database connection after each full runadd dj_tasks.tasks.DeleteOldTaskRunTaskflake8 fixesadd twine for easier releasesmove to GitHub Actions from Travis CIdrop testing with tox1.0.0 (2020-07-01)require settingDJTASKS_LOCK_ID0.1.0 (2020-06-05)First release on PyPI.
Package: djt-csp
djt_cspAdd a panel todjango-debug-toolbarfor checking some security headers.djt_cspis a close copy of theMozilla observatory.Just installdjt-csp...python3-mpipinstalldjt-cspand add "djt_csp.panel.SecurityPanel" to your settingsDEBUG_TOOLBAR_PANELS.# django-debug-toolbarDEBUG_TOOLBAR_PANELS=["debug_toolbar.panels.versions.VersionsPanel","debug_toolbar.panels.timer.TimerPanel","djt_csp.panel.SecurityPanel","debug_toolbar.panels.settings.SettingsPanel","debug_toolbar.panels.profiling.ProfilingPanel","debug_toolbar.panels.headers.HeadersPanel","debug_toolbar.panels.request.RequestPanel","debug_toolbar.panels.sql.SQLPanel","debug_toolbar.panels.templates.TemplatesPanel","debug_toolbar.panels.staticfiles.StaticFilesPanel","debug_toolbar.panels.cache.CachePanel","debug_toolbar.panels.signals.SignalsPanel","debug_toolbar.panels.redirects.RedirectsPanel",]
Package: djtempl
AboutRender a dockerfile from a template and pip requirements.txt.
Docker caches each dockerfile command in it’s own layer.
By breaking out requirements.txt, each pip requirement goes into its own layer and build time improves.Handles all the syntax allowed bypipinrequirements.txtThings like comments, whitespace, line continuations etc. that might choke a simpler solution. Uses the actual parser from pip so guaranteed* compatibility* or your money backUsageStart with a copy your regular Dockerfile called Dockerfile.tmplReplace the pip install command that looks something like this:RUN pip install -r requirements.txtwith some standard django template tags like this:{% for req in pip_requirements %}
RUN pip install --upgrade {{ req }}{% endfor%}djtempl will pass in a tuple calledpip_requirementsinto the template context.pythondjtempl.py-t./Dockerfile.tmpl-p./requirements.txt-d./Dockerfile.out-qInstallationpipinstalldjtempldjtempl.pyis pure python and only requires django>=1.8.0ContributingBug Reports & Feature RequestsPlease use theissue trackerto report any bugs or file feature requests.
Package: djtemps
Djtemps aims to ease  Django - Jinja2 templates integration.Usage:Simply add the following line to your imports::from djtemps import render_to_responseorfrom djtemps import render_to_stringand you're done. You can use both just the same as django's render_to_response,such as...return render_to_response(filename, context, request_context, mimetype)I simply use it as::def view(request):...return render_to_response(template_name, locals())This way all local variables including request context are passed to render_to_responsemethod. Implicit, yet handy when your scope is not much polluted.Ifyou want to use additional filters, extensions or methods within your templatesadd any of the following lines to your settings.py::JINJA_EXTENSIONS = ['name.of.your.extension.module1', 'name.of.your.extension.module2.' ... ]JINJA_FILTERS = ['name.of.your.filter.method1', ...]JINJA_METHODS = ['name.of.your.method', ...]names must be strings, in module name format. such as::JINJA_METHODS = ['djtemps.jinja_methods.enum', 'djtemps.jinja_methods.url_for','djtemps.jinja_methods.pagination', 'djtemps.jinja_methods.logger']By the way djtemps provides the 4 method above by default, just state them in your settings fileas mentioned.Shortly:- enum is enumerate starting from 1 instead of 0, not really sure why i needed it- url_for is identical to url_for in django templates . usage: {{ url_for ('url_name', args, kwargs) }}- pagination is a simple pagination method. usage: {{ pagination(page_obj, request, num_items_per_page) }}- logger is a logging instance enabling logging in templates. usage: {{ logger.debug('Debug message')}}Methods are plain python functions. For filter and extension structure,  you'll needto have a look at the jinja2 documents.There are two extensions in the package for now:1. CsrfExtension providing csrf_token  for using tokens in forms. Simply put it into your form structure, such as:<form method="...>{% csrf_token %}...</form>and you're done. Credit goes to http://djangosnippets.org/snippets/1847/2. Markdown2 extension for enabling markdown2 support in templates. For credits and usage details please refer to http://www.silassewell.com/blog/2010/05/If you want to enable translations in jinja2 templates:- copy the management directory in this package to your apps' directory (your_project/app/management) as a whole- add translation blocks to your jinja2 templates::{% trans %} text to be translated {% endtrans %}- issue the makemessages command as usual. If you use another extension for your jinja templates , declare it with"-e extension" parameter. For example I use .jinja extension for my templates::./manage.py makemessages -l lang_code -e .jinja
Package: dj-termsearch
Simple GET-based term searches for Django CBV’s.DocumentationThe full documentation is athttps://dj-termsearch.readthedocs.org.QuickstartInstall dj-termsearch:pip install dj-termsearchAdd"termsearch"to yourINSTALLED_APPSthen just addTermSearchMixinto a view and go:from django.db import models
from termsearch.views import TermSearchMixin

class MyModelListView(TermSearchMixin, ListView):

    model = MyModel
    term = "title"
    lookup = "iexact"Check the results at:https://example.com/list?q=barryAdvancedUse alistof model fields to use in the search:class AnotherListView(TermSearchMixin, ListView):

    model = MyModel
    terms = ["title", "content", "author__name"]
    lookup = "iexact"Map each field to a lookup type:class YetAnotherListView(TermSearchMixin, ListView):

    model = MyModel
    term_mapping = {
        "title": "icontains",
        "tags__name": "iexact",
        "author__surname": "exact",
    }History0.2.0 (2014-06-23)Added separate search mixins (SingleTermSearchMixin, MultiTermSearchMixin, MapTermSearchMixin).Cleanup of docs.0.1.0 (2014-06-20)First release on PyPI.
Package: djtesseract
djtesseractThis repo forked from (https://github.com/duboisR/django-tesseractfield) to update last release versions of packages, framework, and Python.Repo created by@duboisRoriginally.This module fills the need of having atesseractfieldthat's usable in both
django models and forms.Makes use oftesseract.InstallationRunpip install djtesseractAddtesseractfieldto yourINSTALLED_APPSCollect static files with./manage.py collectstaticUsageTo activate tesseract transcription on your Django site, add this line to your URLconf:path('',include('tesseractfield.urls')),In your models, you can use it like this:fromdjango.dbimportmodelsfromtesseractfield.fieldsimportTesseractFieldclassMyModel(model.Model):content=TesseractField()In your foms, you can use it like this:fromdjangoimportformsfromtesseractfield.fieldsimportTesseractWidgetclassMyForm(forms.Form):content=forms.Textarea()classMeta:widgets={'content':TesseractWidget(),}Maintainers@duboisR@YlmRdmArticlesDjango Tesseract OCR
Package: djtest
djtestAn interactive test runner for Django projects.Purposes:keep the list of apps available for test in a local configuration filedisplay the list of all available unit tests (-l option)run unit tests for apps specified on command linecleanup a test “media folder” before each executionoptionally filter the list of unit tests to be executed (-f option)Installationpip install djtestor:pip install git+https://github.com/morlandi/djtestSample usageUsing config file "./.djtest.conf"
usage: djtest [-h] [-v {0,1,2,3}] [-m] [-n] [-f FILTER] [-l] [apps [apps ...]]

Targets may specify either: 'all' for all available apps, and app name (one or
more), or a specific test module/method

positional arguments:
  apps

optional arguments:
  -h, --help            show this help message and exit
  -v {0,1,2,3}, --verbosity {0,1,2,3}
                        Verbosity level. (default: 2)
  -m, --no-migrations   Skip migrations. (default: False)
  -n, --dry-run         Don't execute commands, just pretend. (default: False)
  -f FILTER, --filter FILTER
                        Filtering: run only test methods matching specified pattern
                        (multiple patterns separated by ',')
  -l, --list            List available test methods
  --version             show program's version number and exit

Available apps: tasks, wallet_clients, frontend_api, trading_api, backendSample config fileA sample “skeleton” config file “./.djtest.conf” is automatically created on first run.You should edit it to specify the list of testable apps.[general]
project=myproject
test_settings_module=myproject.settings.test_settings
test_settings_no_migrations_module=myproject.settings.test_settings_no_migrations
media_folder="../public/test_media/"
apps=app1, app2, appNSample “test settings” modulefrom myproject.settings.settings import *

LANGUAGE_CODE = 'en'
TIME_ZONE = 'UTC'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

...Sample “test settings - no migrations” modulefrom myproject.settings.test_settings import *

class DisableMigrations(object):

    def __contains__(self, item):
        return True

    def __getitem__(self, item):
        #return "notmigrations"
        return None


MIGRATION_MODULES = DisableMigrations()Historyv0.1.9ignore media_folder when emptyv0.1.8force the stdout and stderr streams to be unbufferedv0.1.7fix –list option when no filter have been specifiedv0.1.6Accept multiple filters separated by ‘,’Improved checks for command line parametersv0.1.5Create sample test settings filesrename dry_run and deprecations optionsremoved dependency on “six”v0.1.4config file: use either ‘,’ or spaces as separators in the app listv0.1.3–deprecations switch addedv0.1.2cleanupv0.1.1add test settings example to Readmev0.1.0published on PyPIv0.0.3added versioningadded support for unittest.TestCase