Saravanan666/pypi-org huggingface dataset:
Package: django-trench
django-trenchprovides a set of REST API endpoints to supplementdjango-rest-frameworkwith multi-factor authentication (MFA, 2FA). It supports both standard built-in authentication methods, as well as JWT (JSON Web Token).We deliver a couple of sample secondary authentication methods including sending OTP based code by:E-mailSMS / text3rd party mobile appsYubiKeyDevelopers can easily add their own authentication backends supporting any communication channel.FeaturesEasily pluggable and compatible withdjango-rest-frameworkAllows user to pick an additional authentication method from range of backends defined by a developer. Read more:backendsComes out of a box with email, SMS, mobile apps and YubiKey supportSupported versionsPython 3.7, 3.8, 3.9Django 2.0, 2.1, 2.2, 3.0Django REST Framework 3.10If you are going to use JWT authentication:djangorestframework-simplejwt>= 4.3.0Quick StartInstall the package using pip:pipinstalldjango-trenchor add it to your requirements file.Addtrenchlibrary to INSTALLED_APPS in your app settings file:INSTALLED_APPS=(...,'rest_framework','rest_framework.authtoken',# In case of implementing Token Based Authentication...,'trench',)Run migrationsRead further in:installation.TranslationTrench uses Transifex service to translate our package into other languages.We will appreciate your help with translation.https://www.transifex.com/merixstudio/django-trench/dashboard/Local developmentClone the repo.Crete virtual environment named e.g..venv:virtualenv.venvActivate the virtual environment:source.venv/bin/activateInstall dependencies:pipinstallblackmypypipinstall-rtestproject/requirements.txtSet environment variables:exportPYTHONPATH=./testprojectexportDJANGO_SETTINGS_MODULE=settingsexportSECRET_KEY=YOURsecretGOEShereCreate a symbolic link to thetrench/module inside thetestproject/directory to emulate thetrenchpackage being installed.# make sure you run this command from the root directory of this projectln-s$(pwd)/trench/$(pwd)/testproject/trenchCheck whether the tests are passing:pytest--cov=testproject/trenchtestproject/tests/Remember - anytime you change something in thedjango-trenchsource code you need to re-build and re-install
the package (steps 6-7) for the changes to be present during e.g. running the tests.[OPTIONAL] To make the tests run faster you can try to execute them in parallel.To do so you need to install thepytest-xdistpackage and run the tests
with additional parameter of-n 8where8stands for the number
of threads that will be spawned for executing the tests. Depending on the machine
you’re using using this tool can speed up the test execution process up to 5 times.pytest-n8--cov=testproject/trenchtestproject/tests/
Package: django-tribe-client
=====Django Tribe Client=====Tribe client is a simple `Django <https://docs.djangoproject.com/en/dev/>`_ appto connect your server to the 'Tribe' web service (located athttps://tribe.greenelab.com).This python package allows web servers created using django to connect directlyto Tribe and make use of its resources. Users of the client web server canlogin to access their Tribe resources via Tribe `OAuth2 <http://oauth.net/2/>`_authentication.Download and Install---------------------Tribe-client is registered as "django-tribe-client" in PyPI and is pipinstallable:.. code-block:: shellpip install django-tribe-clientQuick Start---------------------1. Add ``tribe_client`` to your ``INSTALLED_APPS`` setting:.. code-block:: pythonINSTALLED_APPS = (...'tribe_client',)2. Include the tribe-client URLconf in your project's URLconf (usually``urls.py``):.. code-block:: pythonfrom django.conf.urls import url, patterns, includeurlpatterns = patterns('',...(r'^tribe_client/', include('tribe_client.urls')),)3. Register your client server athttps://tribe.greenelab.com/oauth2/applications/. Make sure to:a. Be logged-in using your Tribe accountb. Select "Confidential" under ``Client type`` andc. Select "Authorization Code" under ``Authorization grant type``d. Enter your client server's address plus "/tribe_client/get_token" in the ``Redirect uris`` box. If your client server's current address is http://example.com, enter **http://example.com/tribe_client/get_token**.. note:: Currently, Tribe supports the following ``Authorization grant types``:* Authorization code* Resource owner password-basedand does not support the following:* Implicit* Client credentials4. Write down the Client ID in the ``TRIBE_ID`` setting and the Client secretin the ``TRIBE_SECRET`` setting in your ``settings.py`` file like so:.. code-block:: pythonTRIBE_ID = '*****Tribe Client ID*****'TRIBE_SECRET = '*****Tribe Client Secret*****'5. The ``TRIBE_REDIRECT_URI`` setting should be the address of the clientserver plus "/tribe_client/get_token"... code-block:: pythonTRIBE_REDIRECT_URI = 'http://example.com/tribe_client/get_token'6. Make sure that you have a ``base.html`` template that the tribe_clienttemplates can extend7. Make a link that takes the user to the ``/tribe_client`` url of your websitefor them to log in using TribeA Closer Look-----------------------------Under the hood, tribe-client has functions that:1) Get an access token (via the `OAuth2 <http://oauth.net/2/>`_ protocol) thatallows users to access and create resources in Tribe.2) Retrieves public and private collections (and their versions) and displaysthem on the client server using views and templates included in the package.3) Allows users to create new collections and versions remotely, from theclient server.
Package: django-tricks
Django TricksDjango tricks is a set of useful models, views and admins tools.“I decided after reusing the same model mixins again and again in my projects,
to build a maintainable package with all of them.”—@mariocesarFree software: MIT licenseDocumentation:https://django-tricks.readthedocs.org.History0.1.0 (2016-05-13)First release on PyPI.
Package: django-triflesoft-pages
Can be coinsidered as mini-CMS. Provides database-backed (actual content is
saved in database) and virtual localizable, templatable page implementation.
Body, header and footer can be specified separately. Provides export of any
page in PDF vie weasyprint. Pages maybe HTML UI and JSON API endpoints at the
same time. In case of JSON API view subclasses may add information to response
object without overriding superclass one.
Package: django-triggers
AboutDjango Triggers is a light-weight framework for having one part of an
application generate a trigger while another part responds to to it.
Triggers are persistent and can be scheduled to be processed at a later
time.UsageTriggers are defined by subclassing theTriggermodel.Triggerdefines
common data structures and logic for all child triggers. The only thing a
child should have to do is override the_processmethod and settypedto
a unique slug.SettingsThe following settings are used:DJTRIGGERS_TRIES_BEFORE_WARNING: the number of times a task can be retried before a warning is logged. Defaults to 3.DJTRIGGERS_TRIES_BEFORE_ERROR: the number of times a task can be retried before an error is raised. Defaults to 5.DJTRIGGERS_ASYNC_HANDLING: whether processing should be asynchronous (using Celery) or not. Default to False.DJTRIGGERS_CELERY_TASK_MAX_RETRIES: the number of times the Celery task for a trigger should be retried. Defaults to 0.DJTRIGGERS_TYPE_TO_TABLE: mapping of trigger types to database tables. Used for the cleanup script. Defaults to{}.DJTRIGGERS_REDIS_URL: the URL of the Redis instance used for locks.DJTRIGGERS_LOGGERS: separate logging config for django-triggers. Defaults to().ExamplesGeneral usefromdjtriggers.modelsimportTriggerclassBreakfastTrigger(Trigger):classMeta:# There is no trigger specific data so make a proxy model.# This ensures no additional db table is created.proxy=Truetyped='breakfast'def_process(self,dictionary={}):prepare_toast()prepare_juice()eat()Trigger specific datafromdjtriggers.modelsimportTriggerclassPayBill(Trigger):classMeta:# We need a regular model as the trigger specific data needs a# place to live in the db.proxy=Falseamount=models.IntegerField()recipient=models.ForeignKey(User)def_process(self,dictionary={}):amount=self.amountrecipient=self.recipientcheck_balance()pay_bill(amount,recipient)Trigger processingfrom.modelsimportBreakfastTriggerfrom.exceptionsimportProcessErrortrigger=BreakfastTrigger.objects.get(pk=1)try:trigger.process()exceptProcessErrorase:report_error(e)Delayed processingfrom.modelsimportBreakfastTriggertrigger=BreakfastTrigger()# Process 8 hours later (this can be any datetime)trigger.process_after=now()+timedelta(hour=8)
Package: django-triodia
Triodia is a Django app for parsing taxonomic names and checking them against the databases of public biodiversity data services. Triodia currently relies on the Global Biodiversity Invormation Facility (GBIF) for its primary API calls and can be considered a partial and incomplete Django/Python wrapper for that API.Users enter a species name into a form; Triodia queries the GBIF API, parses the results, and returns a list of potential matches, ranked by confidence.Quick startAdd “triodia” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'triodia',
)Include the triodia URLconf in your project urls.py like this:url(r'^triodia/', include('triodia.urls')),Runpython manage.py syncdbto create the triodia models.Visithttp://127.0.0.1:8000/triodia/to check a species name.
Package: django-tristate
Django Tri-State ModuleBrief introduction to the module and its functionality.InstallationInstructions on how to install thetrimodule.pipinstalldjango-tristate# Example command if available via PyPIConfigurationsettings.pyINSTALLED_APPS = [
...
'tri',
]ContactIoannis Chrysochosioannis.chrysochos@cytanet.com.cy
Package: django-trix
Trix rich text editorwidget for Django, using Trix 0.10.1.Using django-trixdjango-trix includes a form widget, a model field, and a model admin mixin that
enables the rich text editor. You can use any of these methods, but you do not
need to use all.ModelTo enable the editor in the Django admin (or any form) via the model field, use
the Trix model fieldTrixFieldwhich inherits from
django.db.models.TextField:from django.db import models
from trix.fields import TrixField

class Post(models.Model):
    content = TrixField('Content')AdminTo enable the editor in the Django admin, inherit from TrixAdmin and set
thetrix_fieldsattribute to a list of the fields that use an editor:from myawesomeblogapp.models import Post
from trix.admin import TrixAdmin

@admin.register(Post)
class PostAdmin(TrixAdmin, admin.ModelAdmin):
    trix_fields = ('content',)Forms and TemplatesThe editor can be used in forms and templates by adding theTrixEditorwidget
to a form field:from django import forms
from trix.widgets import TrixEditor

class EditorForm(forms.Form):
    content = forms.CharField(widget=TrixEditor)In the template, just use the form as you normally would, but be sure to
include the associated media:<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Trix Editor Test</title>
        {{ form.media.css }}
    </head>
    <body>
        <form>
            {{ form }}
        </form>
        {{ form.media.js }}
    </body>
</html>CSS in head, JS at end of body, because you are a responsible developer.InstallationIt’s onPyPI:pip install django-trixAdd toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'trix',
    ...
)Add route tourls.py:urlpatterns = [
    ...
    url(r'^trixorwhateveryouwant/', include('trix.urls')),
    ...
]TODOA bunch of stuff!Attachment uploads
Package: django-trix-fork
django-trixTrix rich text editorwidget for Django, usingTrix 1.2.3.InstallationFromPyPI:pip install django-trix-forkInstalltrixas app in django Add toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'trix',
    ...
)Add route tourls.py:urlpatterns = [
    ...
    url(r'^trix/', include('trix.urls')),
    ...
]Adddjango-trixvariables to yourapp/settings.py:...
# valid file extentions for attachment 
TRIX_EXTENSIONS = ['.jpg', '.png'] 

# folder where attachments will be saved
TRIX_URI = 'trix' 
...Set-Up trix-django tables:pythonmanage.pymakemigrationstrix
pythonmanage.pymigrateDoneHow to use django-trixdjango-trix includes a form widget, a model field, and a model admin
mixin that enables the rich text editor. You can use any of these
methods, but you do not need to use all.ModelTo enable the editor in the Django admin (or any form) via the model
field, use the Trix model fieldTrixFieldwhich inherits from
django.db.models.TextField:from django.db import models
from trix.fields import TrixField

class Post(models.Model):
    content = TrixField('Content')AdminTo enable the editor in the Django admin, inherit from TrixAdmin and set
thetrix_fieldsattribute to a list of the fields that use an editor:from myawesomeblogapp.models import Post
from trix.admin import TrixAdmin

@admin.register(Post)
class PostAdmin(TrixAdmin, admin.ModelAdmin):
    trix_fields = ('content',)Forms and TemplatesThe editor can be used in forms and templates by adding theTrixEditorwidget to a form field:from django import forms
from trix.widgets import TrixEditor

class EditorForm(forms.Form):
    content = forms.CharField(widget=TrixEditor)In the template, just use the form as you normally would, but be sure to
include the associated media:<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Trix Editor Test</title>
        {{ form.media.css }}
    </head>
    <body>
        <form>
            {{ form }}
        </form>
        {{ form.media.js }}
    </body>
</html>CSS in head, JS at end of body, because you are a responsible developer.What WorksBasically Everything :) from Rich Text formatting to Uploading Attachments  !
Package: django-trix-widget
django-trix-widgetDjango form widget forTrix.RationaleIntegrate Trix editor with Django forms framework.SupportSupports: Python 3.10.Supports Django Versions: 3.2Installation$pipinstalldjango-trix-widgetUsageAddtrix_widgettoINSTALLED_APPS.Run migrations:Import the widget from the package:fromdjangoimportformsfromtrix_widget.widgetsimportTrixWidgetclassMyForm(forms.Form):text=forms.CharField(widget=TrixWidget())
Package: django-trojsten-news
News for django used in Trojsten seminary web appsQuickstartInstall trojsten_django_news:pip install django-trojsten-newsThen use it in a project:import newsFeaturesNewsMarkdownRSS feedRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_dev.txt
(myenv) $ python example/manage.py testCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-06-05)First release on PyPI.
Package: django-trufflehog
Keep track of creation, update and hiding of modelsInstallationThis was developed using:Django 1.7Python 3.4I cannot guarantee it will work for anything older than that, but it probably works for later versions.Install the latest official release usingpip:pip install django-trufflehogYou can install the latest development version using pip:pip install git+git://github.com/jleeothon/trufflehog/UsageWarning.Until release of version 1.0, API is bound to change.ModelsThere are twoModelsubclasses that you can mix into your models:DateTraceableandHideable. The former adds two datetime fields to the model:createdandupdated.To include either or both in a model, mix-in these classes like this:# models.py

from django.db import models
from django.db.models import Model
from trufflehog, import DateTracreable, Hideable

class HappyHog(DateTraceable, Hideable, Model):
    name = models.CharField(max_length=100)
    happiness = models.IntegerField()Given there existshappy_hog =HappyHog(name="Moccus"), check the datetime of creation and edition withhappy_hog.createdandhappy_hog.updated.When checking whether or not a model is hidden,happy_hog.hiddenwill return the datetime of deletion and can be used as a boolean test. If a boolean variable is strictly necessary, you could usehappy_hog.is_hidden.ManagersAdd a manager to peek into only hidden or only visible model instances:# models.py

import trufflehog

class HappyHog(DateTraceable, Hideable, Model):
    # some fields here

    hidden_objects = trufflehog.VisibilityManager(visible=False)
    visible_objects = trufflehog.VisibilityManager(visible=True)But if you want to override the defaultobjectsmanager:objects = trufflehog.VisibilityManager(visible=True)You can also create your own custom managers by mixing-inVisibilityManagerMixin:# mymanagers.py

from django.db import models
import trufflehog.managers

class SuperHappyHogManager(trufflehog.managers.VisibilityManagerMixin, models.Manager):
    def get_queryset(self):
        """
        Only queries on hogs whose happiness is over 9000.
        """
        q = super(HappyHogManager, self).get_queryset()
        q = q.filter(happiness__gt=9000)
        return qThanksWell, thanks. At least for reading this. Also, if you file an issue or contribute to this repository, have my thanks beforehand. Any good or bad ideas or comments are appreciated.
Package: django-trumbowyg
Introductiondjango-trumbowyg is the Django-related reusable app for integratingTrumbowyg WYSIWYG editor. It is recognized as one of thebest WYSIWYG editors.Initially this package was forked fromDjango FS Trumbowygpackage and then reworked.InstallationInstalldjango-trumbowygusingpip:$ pip install django-trumbowygAdd'trumbowyg'to yourINSTALLED_APPSsetting:INSTALLED_APPS = (
    ...
    'trumbowyg',
    ...
)Update yoururls.py:url(r'^trumbowyg/', include('trumbowyg.urls'))Sometimes you might want to limit size of uploaded images, e.g. if they are too large. In this case just put in settings (if you omit this, the image will be uploaded unchanged):TRUMBOWYG_THUMBNAIL_SIZE = (1920, 1080)The package will try to use the language defined inLANGUAGE_CODEand if this language isin’t availabe the default isen(Optional) If you wish image filenames to be transliterated, installunidecodefrom PyPi and set:TRUMBOWYG_TRANSLITERATE_FILENAME = TrueSet [semantics](https://alex-d.github.io/Trumbowyg/documentation/#semantic) if necessary. It defaults tofalse:TRUMBOWYG_SEMANTIC = 'true'Don’t forget to add{{ form.media }}to form template.UsageUseTrumbowygWidgetin your forms:from django.forms import ModelForm
from django.contrib.admin import ModelAdmin
from trumbowyg.widgets import TrumbowygWidget
from your_app.models import YourModel

class YourModelAdminForm(ModelForm):
    class Meta:
        model = YourModel
        widgets = {
            'text': TrumbowygWidget(),
        }

class YourModelAdmin(admin.ModelAdmin):
    form = YourModelAdminForm


admin.site.register(YourModel, YourModelAdmin)CreditsFogstreamAlex-D
Package: django-truncate
Django-Truncate is a simple library that will add the ability to empty
any given model in any app within your django project, in a more SQL related
words it willTRUNCATEtheTABLEwith a simple command:python manage.py truncate --apps myapp --models model1 model2InstallationAfter you move to your django project main directory follow these simple stepsIn your terminal/command line run the following command:pip install django-truncateAdd “django-truncate” to yourINSTALLED_APPSin the settings.py file:INSTALLED_APPS = [
  ...
  'django_truncate',
]And that’s it! you’re now ready to use it.Usage & OptionsYou can truncate all of the tables in one app or multiple apps using–apps:python manage.py truncate --apps appone apptwoIf you want you can truncate a specific table(s) in an app using–models:python manage.py truncate --apps appone --models Model3Note if you don’t write the name of the app the truncate will stop and you’ll see an error message in the terminalRemember you can always see the instructions by running:python manage.py truncate -hLicenseThis project is under the BSD License.
Package: django-trusts
Django Trusts[![Docs](https://readthedocs.org/projects/django-trusts/badge/)](http://django-trusts.readthedocs.org) [![CI](https://travis-ci.org/beedesk/django-trusts.svg?branch=master)](https://travis-ci.org/beedesk/django-trusts) [![Coverage](https://coveralls.io/repos/github/beedesk/django-trusts/badge.svg?branch=master)](https://coveralls.io/github/beedesk/django-trusts?branch=master) [![Version](https://badge.fury.io/py/django-trusts.svg)](https://pypi.python.org/pypi/django-trusts)Django authorization add-on for multiple organizations and object-level permission settingsIntroductiondjango-trustsis a add-on to Django’s builtin authorization. It strives to be aminimalimplementation, adding only a single concept,trust, to enable maintainable per-object permission settings for a django project that hosts users of multiple organizations  with a single user namespace.Atrustis a relationship whereby content access is permitted by the creator [settlor] to specific user(s) [trustee(s)] orgroup(s). Content can be an instance of aContentsubclass, or of an existing model via a junction table. Access to multiple content can be permitted by a singletrustfor maintainable permssion settings. Django’s builtin model,group, is supported and can be used to define reusuable permissions for agroupofuser’s.django-trustsalso strives to be ascalablesolution. Permissions checking is offloaded to the database by design, and the implementation minimizes database hits. Permissions are cached pertrustfor the lifecycle ofrequest user. If a project’s request lifecycle resolves most checked content to one or fewtrusts, which should be very typically the case, this design should be a winner in term of performance. Permissions checking is done against an individual content or aQuerySet.django-trustssupports Django’s builtins User modelshas_perms()/has_perms()and does not provides any in-addition.Read more:http://django-trusts.readthedocs.org/en/latest/TestTo run unit tests:` pip install virtualenv virtualenv venv/ source venv/bin/activate python setup.py test `
Package: django-ts-bridge
# Django TS BridgeCreates a set of management commands that makes it easy to create TypeScript files that easy the usage of Django models within TypeScript## SettingsDJANGO_TS_BRIDGE_EXCLUDED_APPS - Array of apps that shouldn’t be included in generation. Default: [‘rest_framework’, ‘wagtail.api.v2’]DJANGO_TS_BRIDGE_CHOICE_DEFINITION_IMPORT_PATH - The path used to import the generated TypeScript file of the choices available for all Django models. Default: ‘ts/django/django-model-choices’DJANGO_TS_BRIDGE_CHOICE_DEFINITION_OUTPUT_PATH - The output path for the generated Typescript file of the choices available for all Django models. Default: ‘src/ts/django/django-model-choices.ts’DJANGO_TS_BRIDGE_MODEL_DEFINITION_OUTPUT_PATH - The output path for the generated Typescript declaration file for all Django models. Default:‘src/ts/@types/django-models.d.ts’DJANGO_TS_BRIDGE_CHOICE_VAR_NAME - The name of the variable that will hold all Django model choices. Default: ‘Choices’## Management Commandscreate_ts_choice_defs - Creates a TypeScript file that defines all model choice fields based on its [models.TextChoices/models.IntegerChoices](https://docs.djangoproject.com/en/dev/ref/models/fields/#enumeration-types) classcreate_ts_serializer_types - Creates a TypeScript declaration file that defines all the interfaces that will be used by Django Rest Framework Serializer classescreate_ts_files - Convience function to run both create_ts_choice_defs and create_ts_serializer_types at the same time