Saravanan666/pypi-org huggingface dataset:
Package: django-admin-resumable-js
django-admin-resumable-js=========================.. image:: https://api.travis-ci.org/jonatron/django-admin-resumable-js.svg?branch=master:target: https://travis-ci.org/jonatron/django-admin-resumable-jsdjango-admin-resumable-js is a django app to allow you to upload large files from within the django admin site.Screenshot----------.. image:: https://github.com/jonatron/django-admin-resumable-js/raw/master/screenshot.png?raw=trueInstallation------------* pip install django-admin-resumable-js* Add ``admin_resumable`` to your ``INSTALLED_APPS``* Add ``url(r'^admin_resumable/', include('admin_resumable.urls')),`` to your urls.py* Add a model field eg: ``from admin_resumable.fields import ModelAdminResumableFileField``::class Foo(models.Model):bar = models.CharField(max_length=200)foo = ModelAdminResumableFileField()Optionally:* Set ``ADMIN_RESUMABLE_SUBDIR``, default is ``'admin_uploaded'``* Use upload_to instead of ADMIN_RESUMABLE_SUBDIR* Set ``ADMIN_RESUMABLE_CHUNKSIZE``, default is ``"1*1024*1024"``* Set ``ADMIN_RESUMABLE_STORAGE``, default is ``'django.core.files.storage.FileSystemStorage'`` (must be a subclass of ``django.core.files.storage.FileSystemStorage``, or accept the ``location`` init parameter).  If you don't want the default FileSystemStorage behaviour of creating new files on the server with filenames appended with _1, _2, etc for consecutive uploads of the same file, then you could use this to set your storage class to something like https://djangosnippets.org/snippets/976/* Set ``ADMIN_RESUMABLE_SHOW_THUMB``, default is False. Shows a thumbnail next to the "Currently:" link.Versions--------1.0: First PyPI release1.1: Bug fix [1]1.2: Django 1.9 Compatibility2.0: Added upload_to[1] Django silently truncates incomplete chunks, due to the way the multipartparser works: https://github.com/django/django/blob/master/django/http/multipartparser.pyThis could result in a file being unable to be uploaded, or a corrupt file,depending on the situation.Compatibility-------------1.2:{py27,py32,py33,py34,py35}-django{1.6,1.7,1.8,1.9}.python 3.2 and 3.3 supported up to django 1.8.2.0:{py27,py34,py35}-django{1.8,1.9,1.10,1.11}3.0:{py27,py35,py36,py37}-django{1.11,2.0,2.1}python 2.7 supported up to django 1.11Running Tests Locally-------------Incomplete notes[on ubuntu]sudo apt-get install python3-venvpython3 -m venv venvsource venv/bin/activatepip install pytestpip install toxtoxThanks to---------Resumable.js https://github.com/23/resumable.jsdjango-resumable https://github.com/jeanphix/django-resumable
Package: django-admin-row-actions
Django Admin Row ActionsAllows you to easily define a drop-down 'actions' menu that is appended as the final column in your model's changelist and perform actions on that row.Menu items can call urls or methods, can be disabled, have tooltips, etc.I've extracted this from code written forhttp://hireablehq.com/. The admin there has Bootstrap available but I've modified this version to use a standalone jQuery dropdown.InstallationInstall from PyPI:pipinstalldjango-admin-row-actionsor install using pip and git:pipinstallgit+https://github.com/DjangoAdminHackers/django-admin-row-actions.gitAdd to INSTALLED_APPS:INSTALLED_APPS=[...'django_admin_row_actions',...]Add the mixin to your ModelAdmin:fromdjango_admin_row_actionsimportAdminRowActionsMixin...classExampleAdmin(AdminRowActionsMixin,admin.ModelAdmin):...Define aget_row_actionsmethod on your ModelAdmindefget_row_actions(self,obj):row_actions=[{'label':'Edit','url':obj.get_edit_url(),'enabled':obj.statusisnot'cancelled',},{'label':'Download PDF','url':obj.get_pdf_url(),},{'label':'Convert','url':reverse('convert_stuff',args=[obj.id]),'tooltip':'Convert stuff',},{'divided':True,'label':'Cancel','action':'mark_cancelled',},]row_actions+=super(ExampleAdmin,self).get_row_actions(obj)returnrow_actionsThe first three menu items are simple links to a url you provide by whatever means you choose.The final one defines 'action' instead of 'url'. This should be the name of a callable on yourModelAdminorModelclass (similar toModelAdmin.list_display).You can add mouseover tooltips to each individual actions with the 'tooltip' dictionary key, and enable/disable individual actions for each individual object with the 'enabled'.Special option 'divided' can be passed to any item to display horizontal rule above it.CreditsInspired (and code based on):django-object-actionsIncludes parts ofjquery-dropdown; credits go to Cory LaViska.
Package: django-admin-rq
# Django Admin RQDjango admin rq is a django package that creates a 4 step (form, preview, main, complete) asynchronous workflow from a ModelAdmin’s changelist or changeform.
By using the JobAdminMixin class in your ModelAdmin subclass you can define and run jobs by overriding appropriate inherited methods.
It builds upon [django-rq][django-rq].[django-rq]:https://github.com/ui/django-rq# InstallationSetup django-rq according to documentationpip installdjango-admin-rqAdddjango_admin_rqto yourINSTALLED_APPSAdd django-admin-rq.urls to your url configurl(r'^django-admin-rq/', include('django_admin_rq.urls')),Add custom execption handler to queues:`settings.py`RQ_QUEUES = {
    'default': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 0,
        'DEFAULT_TIMEOUT': 360,
    }
}
RQ = {
    'EXCEPTION_HANDLERS': ['django_admin_rq.exceptions.exception_handler']
}Decorate your async tasks with the @job decorator.They take the three arguments all of which need to be pickleable:
-   An instance of django_admin_rq.models.JobStatus
-   The form data from step 1
-   An extra context object you provide if necessaryfrom rq import get_current_job
from django_rq import job

@job
def async_task(job_status, form_data, extra_context):
    job = get_current_job()
    job_status.set_job_id(job.get_id())
    job_status.start()

    ... do your job

    job_status.finish()
Package: django-admin-sbf
Django Admin SBF is a Django admin app to customise the default search functionality to search by specific field instead
of all the fields. This helps in reducing the SQL query overload when there are too much data to process
and multiple fields to search from.Detailed documentation is in the “docs” directory.Quick startInstallpip install django-admin-sbfAdd “django_admin_sbf” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_admin_sbf',
]Extent the admin class for any model usingDjangoAdminSBFinstead ofModelAdminDefinesearch_fieldssame as Django default.ScreenshotsExample@admin.register(Education)
class EducationAdmin(DjangoAdminSBF):

    search_fields = [
        'course',
        'subject
    ]
Package: django-admin-search-builder
django-admin-search-builderDjango app that makes you able to build advanced queries via admin filters UIThis Application aims to give you the faster and easier way to build and run advanced queries through the Django Admin ModelAdmin User Interface, using Django's ORM. See the example project and the gallery.Setuppip install django-admin-search-builderinsettings.INSTALLED_APPSadd'admin_adv_search_builder',in your ModelAdmin, use the following examplefrom admin_adv_search_builder.filters import AdvancedSearchBuilder
from django.contrib import admin

from . models import Identity


@admin.register(Identity)
class IdentityAdmin(admin.ModelAdmin):
    list_filter   = (AdvancedSearchBuilder,)Examplepip install -r requirements.xt

cd example
./manage.py migrate
./manage.py createsuperuser
./manage.py loaddata identity_dumps.json
./manage.py runserverGalleryAuthorsGiuseppe De Marco
Package: django-admin-search-filter
Provides special type of django-admin list filter – search box with free user input allowed.Some cases when you need such functionality:You have a regular search box for general search (multilpe fields taken into account), but you sometimes need to searchby a specific field.You have a regular search box for flexible substring search, while sometimes you need tosearch by exact match. At the same time number of unique values for this field is too big to display them as choices filter (although in this particular case auto-complete could be a better option)The solution provided by this package is you place special (configurable) search input as a list filter.Idea is taken from this Medium article:https://hakibenita.medium.com/how-to-add-a-text-filter-to-django-admin-5d1db93772d8Usage# admin.pyfromdjango_admin_search_filterimportget_exact_equals_input_filter,get_icontains_input_filter...classSomeModelAdmin(...):...list_filter=(...get_icontains_input_filter(title_='name',attrs='name',),# Substring search, one fieldget_icontains_input_filter(title_='(alt)name',attrs=('name','alt_name')),# Substring search, several fieldsget_exact_equals_input_filter(title_='ID of transaction',attrs='transaction_id',),# Exact search, one fieldget_exact_equals_input_filter('ID of transaction/sender/reciever',# Exact search, several fieldattrs=('transaction_id','sender_id','reciever_id')))Will result in the following UI:Installationpip installdjango-admin-search-filterAdd"django_admin_search_filter"to django’sINSTALLED_APPS(to allow template to be loaded)EnsureAPP_DIRSset toTrueintemplates configurationRequirementsPython 3Django >= 2.2LicenceMITAuthorsdjango_admin_search_filterwas written byMikhail Koipish.
Package: django-admin-settings
Django Admin SettingsDescription:A Django application to configure some Django Admin settingsCopyright:2023 Fabio Castelli (Muflone)muflone@muflone.comLicense:GPL-3+Source code:https://github.com/muflone/django-admin-settingsDocumentation:http://www.muflone.com/django-admin-settings/DescriptionDjango Admin Settings allows you to configure some settings in Django Admin.System RequirementsThe Python dependencies for the server part are listed in therequirements.txtfile.Python >= 3.9Django 4.1.x (https://pypi.org/project/Django/)InstallationTo install Django Admin Settings application you can configure theINSTALLED_APPSsetting like this:INSTALLED_APPS=['django_admin_settings',...]ModelsListDisplayTheListDisplaymodels allows you to set the visible fields in the records
list page in Django Admin.You can simply configure your models by settings:ModelField nameSort order numberActive statusListDisplayLinkTheListDisplayLinkmodels allows you to set the clickable fields in the
records list page in Django Admin.You can simply configure your models by settings:ModelField nameSort order numberActive statusListFilterTheListFiltermodels allows you to create filters in the records list page
in Django Admin.You can simply configure your models by settings:ModelField nameSort order numberActive statusDjango settingsADMIN_INDEX_TITLE: Index page titleADMIN_SITE_HEADER: Administration headerADMIN_SITE_TITLE: Administration pages title
Package: django-admin-shuffle
django-admin-shufflesimply shuffles objects on admin changelist view.This app supports the following combinations of Django and Python:DjangoPython2.13.6, 3.7, 3.82.23.6, 3.7, 3.83.03.6, 3.7, 3.8InstallationAdd “admin_shuffle” to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'admin_shuffle',]Integration ExampleAdd mixin to your admin model like thisfromadmin_shuffleimportAdminShuffleMixinclassExampleAdmin(AdminShuffleMixin,models.ModelAdmin):passSettingsSHUFFLE_QS_VALUE: Value of query string. By default, it is set to'SHUFFLE'SHUFFLE_LABEL: Label of the button that shuffles. By default, it is set to'SHUFFLE'Development / ExampleRunpython-mdjango migrate--settings=example.settingsto migrate.Runpython-mdjango runserver--settings=example.settingsto run server.
Package: django-admin-smoke
Django-admin-smokeDjango-Admin-Smoke is a Django app providing smoke tests for django-admin.Installationpipinstalldjango-admin-smokeUsageFull example located attestproject.testapp.testsfromadmin_smoke.testsimportAdminTests,AdminBaseTestCasefromtestproject.testappimportadmin,modelsclassProjectAdminTestCase(AdminTests,AdminBaseTestCase):model_admin=admin.ProjectAdmin# ModelAdmin to testmodel=models.Project# Django model to test againstobject_name='project'# self.project is an edited object in this testcaseexcluded_fields=['client']#  fields excluded from presence checkdefsetUp(self):super().setUp()# We need existing object to test editing and deletingself.project=models.Project.objects.create(name='first')# All inlines for tested model admin should be non-empty, so we fill# all related models.self.task=models.Task.objects.create(name='first',project=self.project)deftransform_to_new(self,data:dict)->dict:# Creating a new object is tested with following algorithm:# 1. Open "edit" page for existing object# 2. Clear PK value in form data# 3. Clear PK values for all related objects in admin inlines# 4. Clear FK values pointing to existing object in admin inlines# 5. POST resulting data to "add" page# This algorithm need some help with unique fields and other constraints# and restrictions, so there is a hook for making newly created object# valid.data=data.copy()# Project.name is unique, making new valuedata['name']+='new'# Manually reset PK/FK values in admin inlinesself.reset_inline_data(data,# form data'task_set',# name of inline prefix - it's FK's related_name'project'# name of edited object FK field (FK.name))# Task.name is also unique, it should be changed properlydata['task_set-0-name']+='_new'returndatadefprepare_deletion(self):# To delete an object with FK's with models.PROTECT behavior we need# a hook to delete it manually before POST delete confirmation.self.task.delete()Happy testing and non-smoky admins :)
Package: django-admin-sortable2
django-admin-sortable2This Django package adds functionality for generic drag-and-drop ordering of items in the List, the Stacked- and the
Tabular-Inlines Views of the Django Admin interface.Check the demo:This library offers simple mixin classes which enrich the functionality of any existing class inheriting fromadmin.ModelAdmin,admin.StackedInlineoradmin.TabularInline.It thus makes it very easy to integrate with existing models and their model admin interfaces. Existing models can
inherit frommodels.Modelor any other class derived thereof. No special base class is required.Version 2.0This is a major rewrite of thisdjango-admin-sortable2. It replaces the client side part againstSortable.JSand thus the need for jQuery.Replacing that library allowed me to add a new feature: Multiple items can now be dragged and dropped together.Project's Homehttps://github.com/jrief/django-admin-sortable2Detailled documentation can be found onReadTheDocs.Before reporting bugs or asking questions, please read thecontributor's guide.LicenseLicensed under the terms of the MIT license.Copyright © 2013-2022 Jacob Rief and contributors.Please follow me onfor updates and other news.
Package: django-admin-sso
NOTE!django-admin-sso uses Google’soauth2clientwhich has been deprecated for a long time; the repository has even been archived by Google now. django-admin-sso isn’t going anywhere but I’d recommend that new projects usedjango-authlib’s Admin OAuth support.Django admin SSODjango admin SSO lets users login to Django’s administration panel using an
OAuth2 provider instead of a username/password combination.Installationdjango-admin-sso is most often used with Google OAuth2 and the instructions
follow that assumption. At least in theory it is possible to use a different
OAuth2 provider.Make sure you have a working Django project setup.Install django-admin-sso using pip:pip install django-admin-ssoAddadmin_ssotoINSTALLED_APPSin yoursettings.pyfile:INSTALLED_APPS = (
    ...
    'admin_sso',
    ...
)Add the django-admin authentication backend:AUTHENTICATION_BACKENDS = (
    'admin_sso.auth.DjangoSSOAuthBackend',
    'django.contrib.auth.backends.ModelBackend',
)Insert your OAuth2 client id and secret key into your settings file:DJANGO_ADMIN_SSO_OAUTH_CLIENT_ID = 'your client id here'
DJANGO_ADMIN_SSO_OAUTH_CLIENT_SECRET = 'your client secret here'Navigate to Google’sDeveloper Console, create a
new project, and create a new client ID under the menu point “APIs & AUTH”,
“Credentials”. The redirect URI should be of the formhttp://example.com/admin/admin_sso/assignment/end/Run./manage.py migrateto create the needed database tables.Log into the admin and add an Assignment.AssignmentsAny Remote User -> Local User XSelect Username mode “any”.Set Domain to your authenticating domain.Select your local user from the User drop down.Remote User -> Local UserSelect Username mode “matches”or“don’t match”.Set username to [not] match by.Set Domain to your authenticating domain.Select your local user from the User drop down.Changelog3.0Dropped support for Django<1.11 and Python<3.Modernized the package and reformatted the code using black.2.4Official support for Django 1.11.2.3Raised the minimum supported Django version to the LTS version, 1.8.Avoid deprecation warnings with Django 1.10.2.2Official support for Django 1.10 (no changes were necessary)Made the admin panel usable on sites with many users.2.1Removed support for OpenIDPython 3 compatibleDropped support for Django versions older than 1.7Continued development asdjango-admin-sso(2.0.x versions were released
independently asdjango-admin-sso2)1.0Add support for OAuth2.0 since google closes its OpenID endpointhttps://developers.google.com/accounts/docs/OpenIDUsing OpenID is now deprecated and OpenID support will be removed in a future release.Add more tests to get a decent coverage.
Package: django-admin-sso2
(Friendly fork, all credit should go to Marc Egli / frog32.)Django admin SSO lets users login to Django’s administration panel using an
OAuth2 provider instead of a username/password combination.Installationdjango-admin-sso is most often used with Google OAuth2 and the instructions
follow that assumption. At least in theory it is possible to use a different
OAuth2 provider.Make sure you have a working Django project setup.Install django-admin-sso2 using pip:pip install django-admin-sso2Addadmin_ssotoINSTALLED_APPSin yoursettings.pyfile:INSTALLED_APPS = (
    ...
    'admin_sso',
    ...
)Add the django-admin authentication backend:AUTHENTICATION_BACKENDS = (
    'admin_sso.auth.DjangoSSOAuthBackend',
    'django.contrib.auth.backends.ModelBackend',
)Insert your OAuth2 client id and secret key into your settings file:DJANGO_ADMIN_SSO_OAUTH_CLIENT_ID = 'your client id here'
DJANGO_ADMIN_SSO_OAUTH_CLIENT_SECRET = 'your client secret here'Navigate to Google’sDeveloper Console, create a
new project, and create a new client ID under the menu point “APIs & AUTH”,
“Credentials”. The redirect URI should be of the formhttp://example.com/admin/admin_sso/assignment/end/Run./manage.py migrateto create the needed database tables.Log into the admin and add an Assignment.AssignmentsAny Remote User -> Local User XSelect Username mode “any”.Set Domain to your authenticating domain.Select your local user from the User drop down.Remote User -> Local UserSelect Username mode “matches”or“don’t match”.Set username to [not] match by.Set Domain to your authenticating domain.Select your local user from the User drop down.Changelog2.0Removed support for OpenIDPython 3 compatible1.0Add support for OAuth2.0 since google closes its OpenID endpointhttps://developers.google.com/accounts/docs/OpenIDUsing OpenID is now deprecated and OpenID support will be removed in a future release.Add more tests to get a decent coverage.
Package: django-admin-tabs
django-admin-tabsIt generates dynamically a directory path and a secure file name for Django FileField.Main options:Ready to use generators.Generate secure file name without especial characters.Generate file name using a uuid value.Dynamically generate paths from the model instance.Generate paths using Python datetime formats.Get startedInstall the django-admin-tabs in your virtual environment$pipinstalldjango-admin-tabsImport it in your models file and add it as aupload_toargument in theFileField# my_app/models.pyfromupload_toimportUploadTofromdjango.dbimportmodelsclassMyModel(models.Model):attachment=models.FileField(upload_to=UploadTo("attachments"))The path and file name generated will be like this:"attachments/the-file-name-uploaded.pdf"How to use the ready-to-use classesConsider the scenario below:importupload_tofromdjango.dbimportmodelsclassMyUser(models.Model):username=models.CharField(...)avatar=models.FileField(upload_to=<generator>)instance=MyUser(username='user@email.com')Replace the<generator>fragment by the generators as showed below:File in root folder>>>generator=upload_to.UploadTo()>>>generator(instance,"file.pdf")"file.pdf"Define a folder structure>>>generator=upload_to.UploadTo(prefix=["files","documents"])>>>generator(instance,"file.pdf")"files/documents/file.pdf"Generate a folder name using datetime formats from Python>>>generator=upload_to.UploadTo(prefix=["pictures","%Y"])>>>generator(instance,"file.png")"pictures/2023/file.png"Replace the file name by an hexadecimal uuid value# 4. replace file name by a uuid value>>>generator=upload_to.UuidUploadTo()>>>generator(instance,"file.pdf")"b189dfdf25e640b2ba5c497472c20962.pdf"Generate the folder path using the instance's attributes>>>generator=upload_to.AttrUploadTo(attrs=["username"])>>>generator(instance,"file.pdf")"useremailcom/file.pdf"Generate the folder path using the app_label and the model_name from the instance's meta options>>>generator=upload_to.ModelUploadTo()>>>generator(instance,"file.pdf")"my_app/user/file.pdf"Customize your upload paths# my_app/models.pyimportupload_tofromdjango.dbimportmodelsdefmy_upload_generator(instance,filename):filename=upload_to.uuid_filename(filename)path=upload_to.options_from_instance(instance)returnupload_to.upload_to(path,filename)classMyProfile(models.Model):user=models.OneToOneField(...)avatar=models.FileField(upload_to=my_upload_generator)Useful linksDocumentationChangelogPyPi Page
Package: django-admin-taggit-ui
DescriptionThis app is build in top ofdjango-taggitand provides a tag-filter and an admin-action to handle tags with ease within
django’s admin backend.Tag-FilterThe tag filter allows you to include and exclude mutliple tags as well as easily
deleting tags.Admin-ActionThe admin action allows you to easily add and remove tags from objects.InstallationInstall from pypi.org:pip install django-admin-taggit-uiSetupAdd more_admin_filters to your installed apps:INSTALLED_APPS = [
    'taggit_ui',
    ...
]Extend yoururl_patternsin urls.py:urlpatterns = [
    ...
    url(r'^', include('taggit_ui.urls')),
]Add theTagFilterandmanage_tagaction to your ModelAdmin:from taggit_ui.filters import TagFilter
from taggit_ui.actions import tag_manager

class MyModelAdmin(admin.ModelAdmin):
    ...
    list_filter = [
        TagFilter,
        ...
    ]
    actions = [
        tag_manager,
        ...
    ]It is possible to optionally tag related items of other models using the admin
action. Therefore initialize theTagManager`class with aModelTree:from taggit_ui.actions import TagManager
from modeltree import ModelTree

class MyModelAdmin(admin.ModelAdmin):
    ...
    actions = [
        TagManager(ModelTree),
        ...
    ]The admin action will then render its form with all taggible related Models as
checkbox fields and the count of related items belonging to these models.
Package: django-admin-tailwind
Django Admin+Tailwind= 🚀django-admin-tailwind is a theme for Django Admin developed with :Tailwind classTailwind formsTailwind dark modeWARNING: Some Django form fields are not yet developed.SetupInstall with pip :pip installdjango-admin-tailwindAdd django-admin-tailwind to django apps installed :INSTALLED_APPS = [
    ...
    'django_admin_tailwind',
    ...
    'django.contrib.admin',
]Devpython manage.py migrate
python manage.py initLog in with django:tailwind
Package: django-admin-testutils
django-admin-testutils contains helpers to make writing selenium unit tests
for the Django admin easier. It is based on the code that supported selenium
unit tests indjango-nested-admin.The test runner is designed to work similarly to the Django framework’s own
runtests.py. Until this project has had documentation written for it, the
best guide on usage can be found in the unit tests for this repository.
Specifically, look atruntests.pyanddjango_admin_testutils/tests/test.py.