Saravanan666/pypi-org huggingface dataset:
Package: django-admin-async-upload
django-admin-async-upload is a django app to allow you to upload large files from within the django admin site asynchrously (using ajax), that means that you can add any number of files on the admin page (e.g. through inline models) and continue editing other fields while files are uploading.django-admin-async-file-uploads is compatible with django-storages (tested with S3Storage)Screenshot#TODO: update this screenshotInstallationpip install django-admin-async-uploadAddadmin_async_uploadto yourINSTALLED_APPSAddurl(r'^admin_async_upload/',include('admin_async_upload.urls')),to your urls.pyAdd a model field eg:from admin_resumable.models import ResumableFileFieldclass Foo(models.Model):
    bar = models.CharField(max_length=200)
    foo = AsyncFileField()Optionally:SetADMIN_RESUMABLE_CHUNKSIZE, default is"1*1024*1024"SetADMIN_RESUMABLE_STORAGE, default is setting of DEFAULT_FILE_STORAGE and ultimately'django.core.files.storage.FileSystemStorage'.  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 likehttps://djangosnippets.org/snippets/976/SetADMIN_RESUMABLE_CHUNK_STORAGE, default is'django.core.files.storage.FileSystemStorage'.  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 likehttps://djangosnippets.org/snippets/976/SetADMIN_RESUMABLE_SHOW_THUMB, default is False. Shows a thumbnail next to the “Currently:” link.SetADMIN_SIMULTANEOUS_UPLOADSto limit number of simulteneous uploads, dedaults to3. If you have broken pipe issues in local development environment, set this value to1.VersionsCompatibilityTested on Django 2.2 running on python 3.6 and 3.7Thanks tooriginal django-admin-resumable-js by jonatronhttps://github.com/jonatron/django-admin-resumable-jsdjango-admin-resumable-js fork by roxelhttps://github.com/roxel/django-admin-resumable-js(django-admin-async-upload is based on this forkResumable.jshttps://github.com/23/resumable.jsdjango-resumablehttps://github.com/jeanphix/django-resumable
Package: django-admin-atlantis
Django Admin AtlantisDjangostarter styled withAtlantis PRO, a premiumBootstrap 4design fromThemeKita.
The product is designed to deliver the best possible user experience with highly customizable feature-rich pages.Features:UI Kit: Atlantis Lite BS4Django Atlantis-Sample projectSections Covered:Admin Section, reserved forsuperusersAll pagesmanaged byDjango.contrib.AUTHRegistrationpageMisc pages: colors, icons, typography, blank-pageWhyDjango Admin AtlantisModernBootstrapDesignResponsive InterfaceMinimal TemplateoverridingEasy integrationAtlantis Dashboard comes with error/bug-free, well structured codebase that renders nicely in all major browsers and devices.How to use itInstall the packageviaPIP$pipinstalldjango-admin-atlantis
//OR
$pipinstallgit+https://github.com/app-generator/django-admin-atlantis.gitAddadmin_atlantisapplication to theINSTALLED_APPSsetting of your Django projectsettings.pyfile (note it should be beforedjango.contrib.admin):INSTALLED_APPS=(...'admin_atlantis.apps.AdminAtlantisConfig','django.contrib.admin',)AddLOGIN_REDIRECT_URLandEMAIL_BACKENDof your Django projectsettings.pyfile:LOGIN_REDIRECT_URL='/'# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend'Addadmin_atlantisurls in your Django Projecturls.pyfilefromdjango.urlsimportpath,includeurlpatterns=[...path('',include('admin_atlantis.urls')),]Collect staticif you are inproduction environment:$pythonmanage.pycollectstaticStart the app$# Set up the database$pythonmanage.pymakemigrations
$pythonmanage.pymigrate
$
$# Create the superuser$pythonmanage.pycreatesuperuser
$
$# Start the application (development mode)$pythonmanage.pyrunserver# default port 8000Access theadminsection in the browser:http://127.0.0.1:8000/Django Admin Atlantis- Modern Admin Interface provided byAppSeed
Package: django-admin-auto
Examplefrom daa.admin import AutoModelAdminfrom django.db.models import Qfrom django.utils.html import format_htmlclass OwnershipModelAdmin(AutoModelAdmin):def get_queryset_Q(self, request):return Q(owner=request.user)def get_form_field_queryset_Q(self, db_field, request):if db_field.name==’account’:return Q(onwer=request.user)def get_form_fields_exclude(self,request,obj=None):return () if obj else (‘owner’,)def action(self,obj):return format_html(‘<a href=”url” class=”button”>Load</a>’)extra=(‘action’,)Installpip install django-admin-auto
Package: django-admin-autocomplete-filter-faisal
Django Admin Autocomplete FilterA simple Django app to render list filters in django admin using autocomplete widget. This app is heavily inspired fromdal-admin-filters.Overview:Django comes preshipped with an admin panel which is a great utility to create quick CRUD's.
The django 2.0 came with much neededautocomplete_fieldswhich uses select2 widget that comes with a search feature that loads the options asynchronously.
We can use this in django admin list filter.Requirements:Requires Django version >= 2.0Installation:You can install it via pip or to get the latest version clone this repo.pip install django-admin-autocomplete-filter-faisalAddadmin_auto_filtersto yourINSTALLED_APPSinside settings.py of your project.Usage:Let's say we have following models:classArtist(models.Model):name=models.CharField(max_length=128)classAlbum(models.Model):name=models.CharField(max_length=64)artist=models.ForeignKey(Artist,on_delete=models.CASCADE)cover=models.CharField(max_length=256,null=True,default=None)And you would like to filter results in Album Admin on the basis of artist, then you can definesearch fieldsin Artist and then define filter as:fromadmin_auto_filters.filtersimportAutocompleteFilterclassArtistFilter(AutocompleteFilter):title='Artist'# display titlefield_name='artist'# name of the foreign key fieldclassArtistAdmin(admin.ModelAdmin):search_fields=['name']# this is required for django's autocomplete functionality...classAlbumAdmin(admin.ModelAdmin):list_filter=[ArtistFilter]'''defining this class is required for AutocompleteFilterit's a bug and I am working on it.'''classMedia:pass...After following these steps you may see the filter as:Now you can also register your custom view instead of using django admin's search_results to control the results in the autocomplete. For this you will need to create your custom view and register the url in your admin class as shown below:In your views.py:fromadmin_auto_filters.viewsimportAutocompleteJsonViewclassCustomSearchView(AutocompleteJsonView):defget_queryset(self):'''your custom logic goes here.'''queryset=Artist.objects.all().order_by('name')returnquerysetAfter this, register this view in your admin class as:classAlbumAdmin(admin.ModelAdmin):list_filter=[ArtistFilter]classMedia:passdefget_urls(self):urls=super().get_urls()custom_urls=[path('custom_search/',self.admin_site.admin_view(CustomSearchView.as_view(model_admin=self)),name='custom_search'),]returncustom_urls+urlsFinally just tell the filter class to use this new view as:classArtistFilter(AutocompleteFilter):title='Artist'field_name='artist'defget_autocomplete_url(self,request,model_admin):returnreverse('admin:custom_search')License:Django Admin Autocomplete Filter is an Open Source project licensed under the terms of the GNU GENERAL PUBLIC LICENSE.
Package: django-admin-autogen
Django Admin AutogenDynamically register all fields of a model or all models in an app, in Django Admin.Installationpipinstalldjango_admin_autogenUsageImportfromdjango_admin_autogen.autogen.adminimportregister_all_fields_of_modelfromdjango_admin_autogen.autogen.adminimportregister_all_models_of_appregister_all_fields_of_modelregister_all_models_of_appRegister a model, with all fields includedfromdjango_admin_autogen.autogen.adminimportregister_all_fields_of_model# '<app_name>', <ModelName>fast_part_note_class=register_all_fields_of_model('notebook','NoteCategory')If your model admin requires using custom base class, you# '<app_name>', <ModelName>, base_class=<YourCustomBaseClass>fast_part_note_class=register_all_fields_of_model('outsource','Quotation',base_class=YourCustomBaseClass)Override the default behavior by setting custom properties on theYourCustomBaseClassclass.# YourCustomBaseClassquotation.field_to_group_by='currency__name'quotation.field_to_sum='total_price'classMedia:js=('js/add_button.js',)fast_part_note_class.Media=MediaRegister all models in an appRegister all models of an app in Django Admin, with all of their fields includedfromdjango_admin_autogen.autogen.adminimportregister_all_models_of_app# <app_name>register_all_models_of_app('outsource')
Package: django-admin-autoregister
Django admin autoregisterThis is a simple app that automatically registers all the models that have not yet been registered to the Django admin.It also does the following:Adds all fields exceptTextFieldtolist_display.Optimizes the database queries by selecting related fields.Adds fields that havechoicesset tolist_filter.If a model only has oneDateFieldorDateTimeFieldit adds that field to thedate_hierarchySetsraw_id_fieldfor related fields andautocomplete_fieldsfor related fields that havesearch_fieldsset.Only registers models that you haven't yet registered.Ignores models that you wish to exclude from the admin.InstallationInstall django-admin-autoregisterpipinstalldjango-admin-autoregisterorpipenvinstalldjango-admin-autoregisterAddadmin_autoregisterto thebottomINSTALLED_APPS setting like this:INSTALLED_APPS=[# ...'admin_autoregister',]Be extra careful to include it as the last app in the list, otherwise your own admin registrations will raise exceptions.All your models should now be registered in the admin.You can use the following settings to tweak the admin auto registration:ADMIN_AUTOREGISTER_EXCLUDEis a list of models to exclude in the admin.Defaults to['contenttypes.ContentType', 'auth.Permission', 'session.Session', 'admin.LogEntry',]'ADMIN_AUTOREGISTER_EXCLUDE_INLINESis a boolean that determines whether or not to exclude models that are already registered as inlines of other models.Defaults toTrueADMIN_AUTOREGISTER_UNREGISTER_LISTis a list of models to unregister from admin. This is usefull when you want to unregister models from other apps such as Celery, Oauth which are registered by default.Defaults to[]MixinsEach of the autoregister features can be used in your registered models by adding them as mixins.The available mixins are:admin_autoregister.mixins.ListDisplayAdminMixin- Populates thelist_displayautomatically.admin_autoregister.mixins.ListFilterAdminMixin- Populates thelist_filterattribute automatically.admin_autoregister.mixins.AutocompleteFieldsAdminMixin- Populates theraw_id_fieldsandautocomplete_fieldsattributes automatically.admin_autoregister.mixins.SelectRelatedFieldsAdminMixin- Automatically selects all related fields with the queryset.admin_autoregister.mixins.DateHierarchyAdminMixin- Automatically sets thedate_hierarchyif there's only oneDateTimeFieldorDateFieldContributingContributions are very welcome - submit a PR!
Package: django-admin-auto-tests
Simple and automated coverage for your Django Admin pages.Create tests to check the correct functioning of your Admin pages. Includes support for:ModelListpage is working.Addpage is working and saves a new record.Modifypage is working and saves a existing record.Deletepage is working and removes a existing record.Add/Delete/Modifypermissions.Using it is as easy as:That is all! But you can personalize it:This module usesdjango-autofixtureto create the information.
Package: django-admin-blame
django-admin-blamedjango-admin-blame is a Django app providing mixins for tracking date and author
of model changes from django admin.DescriptionOften it is useful to know date and author of object creation or modification.
django-admin-blame provides a django model mixin with fields:created (datetime) - timestamp of object creationcreated_by (FK to User) - reference to an admin user who created this object
through admin sitemodified (datetime) - timestamp of last object modificationmodified_by (FK to User) - reference to an admin user who made last changes to
this object through admin site. If changes has been made somewhere else,
field value is reset toNone.Installationpipinstalldjango-admin-blameWorking example is intestproject.testapp.Enable middleware in django settings:MIDDLEWARE.append('admin_log.middleware.AdminLogMiddleware')Add model mixin to your models:fromdjango.dbimportmodelsfromadmin_log.modelsimportAdminLogMixinclassSubject(AdminLogMixin,models.Model):title=models.CharField(max_length=50)content=models.TextField()Add admin mixin to corresponding model admin:fromdjango.contribimportadminfromadmin_log.adminimportAdminLogMixinfromtestproject.testappimportmodels@admin.register(models.Subject)classSubjectAdmin(AdminLogMixin,admin.ModelAdmin):passNow you have readonly fields with date and author of last revision in admin
"edit" page.
Package: django-admin-bootstrapped-compatible
This is a Django-1.9 compatible version ofhttps://github.com/django-admin-bootstrapped/django-admin-bootstrappedInstallation`bash pip install-egit+git://github.com/cesar57927/django-admin-bootstrapped-1.9-compatible.git@master#egg=django_admin_bootstrapped`OR`bash git clonehttps://github.com/cesar57927/django-admin-bootstrapped-1.9-compatiblecddjango-admin-bootstrapped-1.9-compatiblepip install-e. `
Package: django-admin-bootstrapped-plus
Django Admin Bootstrapped Plusis a small Django app
which provides avertical sidebarto the standard Django admin pages,
as provided by the required appDjango Admin Bootstrapped.The vertical sidebar provides a stack of links to all models, grouped by the installed apps.SeeDjango 9cmsfor screenshot.DependenciesPython (3.4+)Django (1.8+): Web frameworkdjango-admin-bootstrapped (2.5+): provide a nicer admin interface experienceQuick how-toThis is a quick guide on how to use it.Install django-admin-bootstrapped-plus:$ pip install django-admin-bootstrapped-plusor download source and place in project rootDependencies (resolved by pip):Django==1.8.7
django-admin-bootstrapped==2.5.6SettingsYou need to install the app inINSTALLED_APPSbefore admin_bootstrapped and before admin,
so that Django loads the templates properly:INSTALLED_APPS = (
    'admin_bootstrapped_plus',
    'django_admin_bootstrapped',
    'django.contrib.admin',
    # ...
)Start the development server and visithttp://127.0.0.1:8000/admin/That’s it.FootnoteAny contribution to the project is highly appreciated and the best will be done to respond to it.
Package: django-admin-buttons
This package used to add a button functionality to the change list
columns in the django admin, it uses the action methods used in theModelAdminI wrote this package as an implementation for this article, it not hard
to write the button yourselfGetting StartedInstall the apppip install django-admin-buttonsAdd the app to theINSTALLED_APPSabove the admin and static appsINSTALLED_APPS = [
    'django_admin_buttons', # add here

    'django.contrib.admin',
    'django.contrib.staticfiles',Use the button as neededfrom django.contrib import admin
from django_admin_buttons.admin_button import AdminActionButton


def Test_function(modeladmin, request, queryset):
    # write you implementation here
    pass

class AdminTest(admin.ModelAdmin):
    # add the button
    list_display = ('id', 'name', 'button')

    # register the function
    actions = [Test_function]

    # create the function that displays the button
    @admin.display()
    def button(self, obj):
        return AdminActionButton(obj.id, 'this', disabled = False, Class='btn-primary', label=None).render()
Package: django-admin-charsleft
# Django CharsLeft Widgets & Admin MixinInspired from [django-charsleft-widget](https://github.com/timmyomahony/django-charsleft-widget/)by [Timmy O'Mahony](https://github.com/timmyomahony)and [django-charsleft-widget](https://github.com/bashu/django-charsleft-widget)by [Basil Shubin](https://github.com/bashu)*django-admin-charsleft* provides a simple way to add information to django's admin interface about the remainingcharacters for both `CharField` and `TextField` inputs, relying on the `max_length` attribute.*django-admin-charsleft* - as the name implies - is intended for the use inside [django-admin](), whereas the originalprojects provide more generic widgets.It plays nice with the default django-admin (>=1.9) - and also seamlessly integrateswith [django-slick-admin](https://github.com/palmbeach-interactive/django-slick-admin).### Screenshot![display example](docs/img/charsleft-example.png)### InstallationUsing the latest version from PyPI:pip install django-admin-charsleftUsing this GitHub repository:pip install -e "git://github.com/palmbeach-interactive/django-admin-charsleft.git#egg=django-admin-charsleft"Then add `charsleft` to `INSTALLED_APPS`.### Usage#### As Admin Mixin*django-admin-charsleft* provides a `CharsLeftAdminMixin` class that can be used to extend your admin classes:from charsleft.admin import CharsLeftAdminMixin@admin.register(MyModel)class MyModelAdmin(CharsLeftAdminMixin, admin.ModelAdmin):...The mixin can be used on `admin.ModelAdmin` and as well on `admin.TabularInline` and `admin.StackedInline`.
Package: django-admincharts
django-adminchartsAddChart.jsvisualizations to your Django admin using a mixin class.Examplefromdjango.contribimportadminfrom.modelsimportBillingAccountfromadmincharts.adminimportAdminChartMixinfromadmincharts.utilsimportmonths_between_dates@admin.register(BillingAccount)classBillingAccountAdmin(AdminChartMixin,admin.ModelAdmin):defget_list_chart_data(self,queryset):ifnotqueryset:return{}# Cannot reorder the queryset at this pointearliest=min([x.ctimeforxinqueryset])labels=[]totals=[]forbinmonths_between_dates(earliest,timezone.now()):labels.append(b.strftime("%b %Y"))totals.append(len([xforxinquerysetifx.ctime.year==b.yearandx.ctime.month==b.month]))return{"labels":labels,"datasets":[{"label":"New accounts","data":totals,"backgroundColor":"#79aec8"},],}InstallationInstall frompypi.org:$pipinstalldjango-adminchartsAddadminchartsto your DjangoINSTALLED_APPS:INSTALLED_APPS=[..."admincharts",]Use theAdminChartMixinwith anadmin.ModelAdminclass to add a chart to the changelist view.Options can be set directly on the class:fromdjango.contribimportadminfromadmincharts.adminimportAdminChartMixin@admin.register(MyModel)classMyModelAdmin(AdminChartMixin,admin.ModelAdmin):list_chart_type="bar"list_chart_data={}list_chart_options={"aspectRatio":6}list_chart_config=None# Override the combined settingsOr by using the class methods which gives you access to the queryset being used for the current view:classMyModelAdmin(AdminChartMixin,admin.ModelAdmin):defget_list_chart_queryset(self,changelist):...defget_list_chart_type(self,queryset):...defget_list_chart_data(self,queryset):...defget_list_chart_options(self,queryset):...defget_list_chart_config(self,queryset):...Thetype,data, andoptionsare passed directly to Chart.js to render the chart.Look at the Chart.js docs to see what kinds of settings can be used.By default, the objects in your chart will be the objects that are currently visible in your list view.
This means that admin controls likesearchandlist filterwill update your chart,
and you can use the Djangopaginationsettingsto control how many objects you want in your chart at a time.
To ignore pagination but still respect search/filter,
you can override theget_list_chart_querysetmethod to return the full queryset:classMyModelAdmin(AdminChartMixin,admin.ModelAdmin):defget_list_chart_queryset(self,changelist):returnchangelist.querysetAnd if you want, you can also sidestep the list queryset entirely by using overridingget_list_chart_querysetwith your own query:classMyModelAdmin(AdminChartMixin,admin.ModelAdmin):defget_list_chart_queryset(self,changelist):returnMyModel.objects.all()
Package: django-admin-chat
Django Admin ChatAdd chat to djangoQuick startAdd "chat" to INSTALLED_APPS:INSTALLED_APPS = {
    ...
    'chat'
  }Include the chat URLconf in urls.py:path('', include('chat.urls'))Runpython manage.py makemigrations
  python manage.py migrateRun the development server and accesshttp://127.0.0.1:8000/admin/chat/to manage chats.
Package: django-admin-ckeditor
Basically this is just the CKEditor javascript files with a 'fields.py'file providing a 'RichTextField' and a 'CkeditorWidget' that attachesthe proper javascript to the form field widget.1. Declare a model with a 'RichTextField'.2. in the admin.py, use the formfield overrides to add the CKeditor widgetto rich text fields.--- models.py ---from ckeditor.fields import RichTextFieldclass SampleModel(models.Model):description = RichTextField()--- admin.py ---from ckeditor.fields import RichTextField, CkeditorWidgetclass SampleModelAdmin(admin.ModelAdmin):formfield_overrides = {RichTextField: {'widget': CkeditorWidget},}
Package: django-admin-cli
Django third app for manage you models in command line environment.Table of contentFeaturesInstallUsageList model’s instanceList specified fieldsFilter specified fieldsAdd an instanceUpdate an instanceDelete an instanceResctrict access to usersTestingOnline resourcesFeaturesThis app is based on Django Admin Site and ModelAdmin defined by developpers.
It is supposed to allow user to make same things as in Admin site:List model’s instance:Filtering with Django’s LookupChoosing which field you want including ModelAdmin and Model attributesDefault display is the Admin oneAdd an instance:Prepopulate with default valuesUpdate instances:Filtering with Django’s LookupDelete instances:Filtering with Django’s LookupDescribe model and modeladminSystem user restriction (Read/Write)Use admin actions (further)InstallInstall the package on your system:pip install django-admin-cliAddadmin_clitoINSTALLED_APPS.UsageList model’s instance$ ./manage.py cli user list
Username                      Email address                 First name                    Last name                     Staff status
zulu                                                                                                                    True
admin                                                                                                                   TrueList specified fields$ ./manage.py cli user list -f id -f username
Id                   Username
1                    zulu
2                    adminFilter specified fields$ ./manage.py cli user list -F id=1
Username                      Email address                 First name                    Last name                     Staff status
zulu                                                                                                                    TrueAdd an instance$ ./manage.py cli site add -f domain=mysite.org -f 'name=My site'
Created 'mysite.org'Update an instance$ ./manage.py cli site update -F domain=mysite.org -f 'name=New name'
Update 'mysite.org' ? [Yes|No|All|Cancel] y
Updated 'mysite.org'Delete an instance$ ./manage.py cli site delete -F domain=mysite.org
Delete 'mysite.org' ? [Yes|No|All|Cancel] y
Deleted 'mysite.org'Resctrict access to usersPut adictnamedADMIN_CLI_USERSinsettings.py. It must have
the following format:ADMIN_CLI_USERS = {
  'login': 'RW',
}Keys are UID or username, values are rights ‘R’ for read, ‘W’ for
write/update/delete and ‘RW’ for both.By defaultADMIN_CLI_USERSis{}which allows all users to make
all operations.TestingAll tests are simply launched by:python setup.py testOnline resourcesCode repositoryDocumentationTravis CI serverCoveralls reportLandscape