Saravanan666/pypi-org huggingface dataset:
Package: django-admin-filter
DescriptionDjango-admin-filter is a generic form-based filter for the django-admin-page.
It is based ondjango-filter. It provides a flexible and direct way to filter
the items of your changelist and to save and reuse your queries.InstallationInstall from pypi.org:pip install django-admin-filterSetupThere are a few things you need to do to use a custom filter-form for your model
in your admin changelist:Adddjango_admin_filterto yourINSTALLED_APPS:INSTALLED_APPS = [
   'django_admin_filter',
   ...
]Include the django_admin_filter.urls into your project urlpatterns. The
django_admin_filter.urls must precede the admin.site.urls:urlpatterns = [
   path('admin/', include('django_admin_filter.urls')),
   path('admin/', admin.site.urls),
   ...
]Add theCustomFilterto thelist_filterof your ModelAdmin:from django_admin_filter.filters import CustomFilter

class MyAdmin(admin.ModelAdmin):
   list_filter = [CustomFilter, ...]
   ...And setup the filter-class you want to use with your model. This works exactly
as described in thedjango-filter-docs. But to use your filter-class with the
django-admin-filter there is one thing to mind: Instead of subclassdjango_filters.FilterSet:import django_filters

class MyFilter(django_filters.FilterSet):
   ...use theAdminFilterSet:from django_admin_filter.filterset import AdminFilterSet

class MyFilter(AdminFilterSet):
   ...Configurationdjango_admin_filter defines some settings by its own. These settings and their
default values are:ADMIN_FILTER_HISTORY_LIMIT = 3
ADMIN_FILTER_TRUNCATE_HISTORY = True
ADMIN_FILTER_URL_PATH = 'filter/'ADMIN_FILTER_HISTORY_LIMITFilter queries that are not saved but only applied will be kept in the history
section of the custom filter. The HISTORY_LIMIT setting defines how many applied
filter queries will be kept. If you do not want to have a history of your
applied queries at all set this setting to 0.ADMIN_FILTER_TRUNCATE_HISTORYBy default applied filters that are beyond the scope of the filter history will
be delete automatically from the database. Set this setting to False if you want
to keep them for any reason.ADMIN_FILTER_URL_PATHBy default the route for the filter query form will be composed as follows:<app-label>/<model>/filter/[<pk>]If this does not work with your project you can alter the “filter/” part by
using the ADMIN_FILTER_URL_PATH setting.UsageThe CustomFilter will show up on the right with all the other list filters. It
allows you to create new queries - based on your AdminFilterSet - or apply
existing queries - either recent ones from the history, or those you created.
It is also possible to create globel filter queries that can be used by every
user. To do so a user must have an extra permission defined with the FilterQuery
model:"Can handle global FilterQueries"Users with this permission can commonly create edit and delete global filters.
Package: django-adminfilters
django-adminfiltersCollection of extra filters for the Django admin siteDemo can be found athttps://django-adminfilters.herokuapp.com/demo/artist/https://user-images.githubusercontent.com/27282/153727131-d875f946-a8a8-4d89-be83-1d8cb5c9391a.mp4FiltersAutocompleteAutocompleteFilterSimpleValueFilterComboboxAllValuesComboFilterRelatedFieldComboFilterChoicesFieldComboFilterDatesDateRangeFilterRadioAllValuesRadioFilterRelatedFieldRadioFilterChoicesFieldRadioFilterBooleanRadioFilterCheckboxRelatedFieldCheckBoxFilterMultipleMultiValueFilterManyToManyIntersectionFieldListFilterUnionFieldListFilterJSONJsonFieldFilterNumberNumberFilterSpecialQueryStringFilterDjangoLookupFilterPermissionPrefixFilterFYIFilters management (save/retrieve), is handled by an optional applicationadminfilters.depotthat,
due to the Django filters internal design, it uses GET method to save filter definition to the database.
When you useFilterDepotManagerto save a filter, the call isidempotentbut notsafe.Usage examplesclass MyModel(models.Model):
    index = models.CharField(max_length=255)
    name = models.CharField(max_length=255)
    age = models.IntegerField()
    flag = models.CharField(default="1", choices=(("0", "Flag 1"), ("1", "Flag 2"))
    household = models.ForeignKey('Household')
    custom = JSONField(default=dict, blank=True)

class MyModelAdmin(ModelAdmin):
    list_filter = (
        FilterDepotManager,  # needs `adminfilters.depot` app
        QueryStringFilter,
        DjangoLookupFilter,
        ("custom", JsonFieldFilter.factory(can_negate=False, options=True)),
        ("flag", ChoicesFieldComboFilter),
        ('household', AutoCompleteFilter)
        ('name', ValueFilter.factory(lookup='istartswith'),
        ("age", NumberFilter),
    )Run demo app$ git clone https://github.com/saxix/django-adminfilters.git
$ cd django-adminfilters
$ python3 -m venv .venv
$ source .venv/bin/activate
$ make develop
$ make demoProject linksProject home page:https://github.com/saxix/django-adminfiltersDownload:http://pypi.python.org/pypi/django-adminfilters/Documentation:https://django-adminfilters.readthedocs.io/en/latest/
Package: django-admin-filtrate
## About ##This Django app makes it easier to create custom filters in the change list ofDjango Admin and supplies a `TreeFilter` and a `DateRangeFilter` too. Se below.Tested on Django 1.2.3 and from @15ea9a9 1.3.1.## Updating to 1.3 support ##I will write proper docs, things are getting messy here, but here is thelowdown.### New settings required ###As I found out, you can't reliably convert the django date formats toDatepicker formats. So this commit introduces these two new settings:FILTRATE = {# See http://jqueryui.com/demos/datepicker/#localization.'datepicker_region': 'en-GB',# See http://docs.jquery.com/UI/Datepicker/formatDate.'datepicker_date_format': 'yy-mm-dd',}So if the above defaults does not suit you, you have to change them your self.Check out the Datepicker documentation to see how to use them.### lookup_allowed() ###Django 1.2.4 introduces restrictions on which lookups that can be queriedin the url, so at the moment the end user are responsible forchecking for those, as in this example:class CaseAdmin(admin.ModelAdmin):list_filter = ['client']def lookup_allowed(self, key, *args, **kwargs):if 'client__start_date' in key:return Trueelse:return super(CaseAdmin, self).lookup_allowed(key, *args, **kwargs)### Undefined Media() class bug ###Time and my Python meta-fu is running out, and I couldn't fix itso its not neccessary to define an empty Media() class as in:class CaseAdmin(admin.ModelAdmin):class Media():pass## The FiltrateFilter ##The base class that adds support for custom html in the content of the filterand for using `Media()` classes.## TreeFilter ##A recursive tree filter using the excellent library http://www.jstree.com/.### Example ###```python# The Filter.from filtrate.filters import TreeFilterfrom itertools import groupbyclass CompanyDepartmentFilter(TreeFilter):field_name = "client__department__id__in"def get_title(self):return 'By Department'def get_tree(self):from company.models import Departmentqs = Department.objects.all().order_by('company_order', 'company')return groupby(qs, lambda obj: getattr(obj, 'company'))# The model.from filtrate import register_filterclass Case(Model):...register_filter(field_name, CompanyDepartmentFilter)...```## DateRangeFilter ##Filters results in a given date range using the jQueryUI datepicker plugin.### Example ###```python# The Filter.from filtrate.filters import DateRangeFilterclass CaseLicenseStartDateFilter(DateRangeFilter):field_name = 'caselicense__start_date'def get_title(self):return "By license start date"# The model.from filtrate import register_filterclass Case(Model):...register_filter(field_name, CaseLicenseStartDateFilter)...```## Installation ##* Clone the repo and symlink or copy the "filtrate" folder to your apps folder.* Add `filtrate` to your installed apps.* Add the "filtrate/templates" folder to your template folders.### Static files ###FlexSelect requires "django.contrib.staticfiles" installed to work out of thebox. If it is not then the js and css files must be installed manually.Read more about "django.contrib.staticfiles" athttps://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/.
Package: django-admin-fix-ie-compatible
django-admin-fix-ie-compatibleAdd X-UA-Compatible meta to django's admin site, so that the admin site can work in IE's compatible mode under IE9 or high version.Installpipinstalldjango-admin-fix-ie-compatibleSettingspro/settings.pyINSTALLED_APPS=[...'django_admin_fix_ie_compatible',...]Note:Just add django_admin_fix_ie_compatible to INSTALLED_APPS, and nothing more.Releasesv0.1.1 2020/03/09Fix requirements.txt reading problem in setup.py.v0.1.0 2020/03/09First release.
Package: django-admin-footer
django-admin-footerprovides a templatetag that renders a footer with
version information in the Django admin.InstallationUsepipto install the download and install the package fromPyPi:pip install django-admin-footerOr checkout the source code fromGithub:git clone https://github.com/collab-project/django-admin-footer.git
cd django-admin-footer
pip install -e .Addadmin_footertoINSTALLED_APPSin your Django project settings:INSTALLED_APPS=(...'admin_footer',)UsageTheADMIN_FOOTER_DATAsettings dict provides the data used in your footer.
The default template expects the following template vars:site_url,site_name,periodandversion.For example insettings.py:fromdatetimeimportdatetimefrommyappimportversionADMIN_FOOTER_DATA={'site_url':'https://www.google.com','site_name':'Google','period':'{}'.format(datetime.now().year),'version':'v{}- '.format(version)}Load the tag in your admin template (e.g.admin/base.html):{%loadfooter%}And add theadmin_footertag to thefooterblock:{%blockfooter%}{%admin_footer%}{%endblock%}You’ll now see a copyright link at the bottom of the admin pages.
Theversioninformation is hidden for non-staff users.
Package: django-adminform
This package is forked fromdjango-jsonformInstallInstall via pip:$pipinstalldjango-adminformEdit yoursettings.pyfile:# settings.pyINSTALLED_APPS=[# ...'django_adminform']LicenseBSD-3-ClauseCopyright (c) 2021, Bharat ChauhanRedistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: django-admin-form-action
django-admin-form-actiondjango-admin-form-actionis intended to implement parametrized actions on the Django admin site.
Action parameters are passed through an intermediate form as it shown below.The demonstrated functionality can be implemented withdjango-admin-form-actionin the following way:fromdjangoimportformsfromdjango.contribimportadminfromdjango.contrib.auth.modelsimportGroup,Userfromadmin_form_actionimportform_actionclassGroupsForm(forms.Form):groups=forms.ModelMultipleChoiceField(queryset=Group.objects.all())defadd_user(self,user:User):user.groups.add(*self.cleaned_data['groups'])@admin.register(User)classUserAdmin(admin.ModelAdmin):actions=['add_to_groups']@form_action(GroupsForm)@admin.action(description='Add selected users to certain groups')defadd_to_groups(self,request,queryset):# Validated form is injected by `@form_action` to `request.form`groups_form=request.formforuserinqueryset:groups_form.add_user(user)Installpipinstalldjango-admin-form-actionINSTALLED_APPS=[...'admin_form_action',...]DevelopmentRun demo apppoetryinstall
poetryrundjango-adminmigrate--settings=tests.app.settings
poetryrundjango-adminrunserver--settings=tests.app.settingsTestpoetryrunpytestLintpoetryrunisort.
poetryrunruff.poetryrunmypy.
Package: django-admin-generator
IntroductionBuild status:Coverage:The Django Admin Generator is a project which can automatically generate
(scaffold) a Django Admin for you. By doing this it will introspect your
models and automatically generate an Admin with properties like:list_displayfor all local fieldslist_filterfor foreign keys with few itemsraw_id_fieldsfor foreign keys with a lot of itemssearch_fieldsfor name andslugfieldsprepopulated_fieldsforslugfieldsdate_hierarchyforcreated_at,updated_atorjoined_atfieldsLinksDocumentationhttp://django-admin-generator.readthedocs.org/en/latest/Sourcehttps://github.com/WoLpH/django-admin-generatorBug reportshttps://github.com/WoLpH/django-admin-generator/issuesPackage homepagehttps://pypi.python.org/pypi/django-admin-generatorMy bloghttp://w.wol.ph/InstallTo install:Runpip installdjango-admin-generatoror executepython setup.py installin the source directoryAdddjango_admin_generatorto yourINSTALLED_APPSIf you want to run the tests, runpy.test(requirespytest)UsageTo generate an admin for a given app:./manage.py admin_generator APP_NAME >> APP_NAME/admin.pyTo generate an admin for a given app with all models starting with user:./manage.py admin_generator APP_NAME ‘^user’ >> APP_NAME/admin.py
Package: django-admin-generator-blokz
IntroductionThe Django Admin Generator is a project which can automatically generate
(scaffold) a Django Admin for you. By doing this it will introspect your
models and automatically generate an Admin with properties like:list_displayfor all local fieldslist_filterfor foreign keys with few itemsraw_id_fieldsfor foreign keys with a lot of itemssearch_fieldsfor name andslugfieldsprepopulated_fieldsforslugfieldsdate_hierarchyforcreated_at,updated_atorjoined_atfieldsLinksDocumentationhttp://django-admin-generator.readthedocs.org/en/latest/Sourcehttps://github.com/blok-z/django-admin-generatorBug reportshttps://github.com/blok-z/django-admin-generator/issuesPackage homepagehttps://pypi.org/project/django-admin-generator-blokz/1.1.3/InstallTo install:Runpip install django-admin-generator-blokzor executepython setup.py installin the source directoryAdddjango_admin_generatorto yourINSTALLED_APPSIf you want to run the tests, runpy.test(requirespytest)UsageTo generate an admin for a given app:./manage.py admin_generator APP_NAME >> APP_NAME/admin.pyTo generate an admin for a given app with all models starting with user:./manage.py admin_generator APP_NAME ‘^user’ >> APP_NAME/admin.pyPublish to pypiNow that the code for the python package is almost complete,
you can start building the distribution archives.First delete previous distributions:rm -rf distArchives are compressed files that help your package to be deployed across multiple platforms
and also make it platform independent.In order to generate the distribution archives, run the following command from your terminal.python3 -m pip install –user –upgrade setuptools wheelThis will upgrade your setuptools library on your machine to use the latest version.
After this, you need to run the following command from the root directory of your package
to generate the distribution files.python3 setup.py sdist bdist_wheelOnce you run the above command, you can see that the distribution packages will be
delivered under the directories — build and dist, that are newly created.In addition to that, you can also see that the egg file information has been updated
in the project source code as well.Now that we have our distribution files ready, we can go ahead and try installing
and importing the package to test if it works fine.In order to install the package on your local machine,
run the following command from the root directory.python3 -m pip install –user -e .Once the package is installed on local and works fine,
it is now ready to be shipped to the PyPi repository.Install a package called “twine” on your machine that will help ship
the python package to the repositories.python3 -m pip install –user –upgrade twineUpload the package to PyPi. You can login with the project token set in PyPi.
You can set the username to__token__and the password to the access code saved earlier.
You can also generate a new token.python3 -m twine upload dist/*
Package: django-admin-global-search
Django Admin Global SearchIntroductionThis Django application introduces a GlobalSearchView, designed to perform a global search across various models within the Django admin site.FeaturesGlobal Search: Enables searching across multiple models from a single query.Dynamic Model Inclusion: Automatically includes models that defineglobal_search_fields, allowing for flexible search configurations.Admin Integration: Provides direct links to the admin change page for each search result, facilitating easy editing.Getting Started:PrerequisitesPython versions 3.8+.Django version 3+Installation StepsInstall with commandpip install django-admin-global-search.UsageTo usedjango-admin-global-searchin your Django project, you need to update your models and URL configurations.Addadmin_global_searchto yourINSTALLED_APPSsetting beforedjango.contrib.admin.INSTALLED_APPS=["admin_global_search","django.contrib.admin","django.contrib.auth","django.contrib.contenttypes",...]Ensure your models have aglobal_search_fieldsattribute that specifies the fields to be included in the search. Example:classArtist(models.Model):name=models.CharField(max_length=100)bio=models.TextField(blank=True)global_search_fields=("name","bio")def__str__(self):returnself.nameUpdate your project's urls.py to include the GlobalSearchView. Example:...fromadmin_global_search.viewsimportGlobalSearchViewurlpatterns=[path("admin/",admin.site.urls),path("search/",GlobalSearchView.as_view(),name="admin_global_search"),...]ContributingContributions to the project are welcome. To contribute:Fork the repository.Create a new feature branch for your contribution.Commit your changes with a descriptive message.Push your changes to GitHub.Submit a pull request for review.LicenseThe project is made available under theBSD 3-Clause License. Please refer to the LICENSE file for more details.
Package: django-admin-highcharts
django-admin-highcharts/README.rst=====admin-highcharts=====help to add highcharts in django adminDetailed documentation is in the "docs" directory.Quick start-----------1. Add "admin_highcharts" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'admin_highcharts',)2. add highchart to admin your app model,for example::your model defined(models.py)class MyStats(models.Model):stats_date = models.DateField()pv = models.IntegerField()uv = models.IntegerField()admin your model(admins.py)from django.contrib import adminfrom .models import MyStatsfrom admin_highcharts.admin import HighchartsModelAdminadmin.site.register(MyStats,HighchartsModelAdmin,list_display=('stats_date','pv','uv'))3. advance method in HighchartsModelAdmin::chart_category_name:default -> the first elem in list_display,you can set manualchart_serial_names:default -> list_display exclude chart_category_name,you can set manualchart_type:default -> lineoptions: line,column,area,areaspline,spline,for example:admin.site.register(MyStats,HighchartsModelAdmin,list_display=('pv','uv','stats_date'),chart_serial_names=('uv',))or@admin.register(MyStats)class MyStatsAdmin(HighchartsModelAdmin):list_display=('pv','uv','stats_date')chart_serial_names=('uv',)
Package: django-admin-history
History is a Django app to log change model fieldsDetailed documentation is in the “docs” directory.Quick startAdd “django_history” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_history',
    ...
]Add middleware to your MIDDLEWARE:MIDDLEWARE = [
    ...
    'django_history.middleware.ThreadLocals',
]Add models fields to your OBSERVED_FIELDS:OBSERVED_FIELDS = {
    'accounts.User':
            (
                  'username', 'first_name', 'middle_name', 'last_name', 'gender', 'phone', 'email',
                  'photo', 'birthday',
            ),
    ...
}Use to admin.py:from django.contrib import admin
from django_history.admin import HistoryBlockAdmin

@admin.register(App)
class AppAdmin(HistoryBlockAdmin, admin.ModelAdmin):
    ...Runpython manage.py migrateto create the history models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a history (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/admin/django_history/action/to participate in the all history.
Package: django-admin-honeypot
django-admin-honeypotis a fake Django admin login screen to log and notify
admins of attempted unauthorized access. This app was inspired by discussion
in and around Paul McMillan’s security talk at DjangoCon 2011.Author:Derek PaytonVersion: 1.1.0License: MITDocumentationhttp://django-admin-honeypot.readthedocs.iotl;drInstall django-admin-honeypot from PyPI:pip install django-admin-honeypotAddadmin_honeypottoINSTALLED_APPSUpdate your urls.py:urlpatterns = patterns(''
    ...
    url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
    url(r'^secret/', include(admin.site.urls)),
)Runpython manage.py migrateNOTE: replacesecretin the url above with your own secret url prefix
Package: django-admin-honeypot1
django-admin-honeypot-2django-admin-honeypotis a fake Django admin login screen to log and notify
admins of attempted unauthorized access. This app was inspired by discussion
in and around Paul McMillan's security talk at DjangoCon 2011.Author:Derek Payton_Contributor:Kalyaan SinghVersion: 1.2.0License: MITDocumentationhttp://django-admin-honeypot.readthedocs.iotl;drInstall django-admin-honeypot from PyPI::pip install django-admin-honeypotAddadmin_honeypottoINSTALLED_APPSsetting like this
::INSTALLED_APPS = [
  ...
  'admin_honeypot',
  ]Update your urls.py:
::urlpatterns =[

    path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
    path('secret/', admin.site.urls),
    ...
    ][ Optional ] In settings.py:
::# To receive email notifications regarding attempts to login to the admin honeypot.

# Admin's name and email to send email
        ADMINS = (
        (admin_name, admin_email_addrress)
        )

# SMTP CONFIGURATION
        EMAIL_HOST = smtp.gmail.com
        EMAIL_PORT = 587
        EMAIL_HOST_USER = admin_email_addrress
        EMAIL_HOST_PASSWORD = admin_email_addrress_password
        EMAIL_USE_TLS = TrueRunpython manage.py migrateto create the LoginAttempt modelNOTE: replacesecretin the url above with your own secret url prefix
Package: django-admin-honeypot-2
django-admin-honeypotis a fake Django admin login screen to log and notify
admins of attempted unauthorized access. This app was inspired by discussion
in and around Paul McMillan’s security talk at DjangoCon 2011.Author:Derek PaytonVersion: 1.1.0License: MITDocumentationhttp://django-admin-honeypot.readthedocs.iotl;drInstall django-admin-honeypot from PyPI:pip install django-admin-honeypotAddadmin_honeypottoINSTALLED_APPSUpdate your urls.py:urlpatterns = [
    ...
    path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
    path('secret/', admin.site.urls),
]Runpython manage.py migrateNOTE: replacesecretin the url above with your own secret url prefix