Saravanan666/pypi-org huggingface dataset:
Package: django-address-model
django abstract model that provide the complete address, eg: no, na/rt, ca/rw, village,
sub district, district, province, country, postal code, currency code, phone code, etc.Support LanguagesID - IndonesiaQuick startDjango Log Viewer is available directly fromPyPI:pip install django-address-modelAdd"django_address"to yourINSTALLED_APPSsetting like thisINSTALLED_APPS = [
    ...
    "django_address",
]Create an initial addresspython manage.py create_address --language=id --show-print=trueUsage ExampleIn yourmodels.pyfrom django.db import models
from django_address.models import AddressModel


class Profile(AddressModel, models.Model):
    name = models.CharField(max_length=100)
    email = models.EmailField(blank=True, null=True)
    phone = models.CharField(max_length=15, blank=True, null=True)

    def __str__(self):
        return self.name

    class Meta:
        ordering = ('-id',)ORM Usage Example>>> from django_address.models import SubDistrict
>>> from app.models import Profile
>>>
>>> sub_district = SubDistrict.objects.first()
>>> profile_data {'name': 'Summon Agus', 'email': 'summon@mail.com', 'phone': '+6282133338888',
                  'address': 'Jl. Karto Dimejo', 'number': 35, 'na': 3, 'ca': 34, 'village': 'Sinduarjo',
                  'sub_district': sub_district}
>>> profile = Profile.objects.create(**profile_data)
>>> profile.number
35
>>> profile.address
'Jl. Karto Dimejo'
>>> profile.village
'Sinduarjo'
>>> profile.sub_district
'Ngaglik'
>>> profile.sub_district.district
'Sleman'
>>> profile.get_full_address(format_address='id', include_country=True)
'Jl. Karto Dimejo No.35, RT.3/RW.34 Sinduarjo, Ngaglik, Sleman, Yogyakarta, Indonesia - 55581'
>>>
>>> profile.get_full_address_json()
{
  'na': 3,
  'ca': 34,
  'number': 35,
  'village': 'Sinduarjo',
  'address': 'Jl. Karto Dimejo',
  'sub_district': {
    'id': 1,
    'district': 1,
    'deleted_at': None,
    'postal_code': '55581',
    'name': 'Ngaglik'
  },
  'district': {
    'id': 1,
    'name': 'Sleman',
    'deleted_at': None,
    'province': 1
  },
  'province': {
    'id': 1,
    'name': 'Yogyakarta',
    'deleted_at': None,
    'country': 1
  },
  'country': {
    'id': 1,
    'phone_code': '+62',
    'deleted_at': None,
    'name': 'Indonesia',
    'currency_code': 'IDR',
    'code': 'ID',
    'states': [
      'Aceh',
      'Bali',
      'Banten',
      'Bengkulu',
      'Gorontalo',
      'Jakarta',
      'Jambi',
      'Jawa Barat',
      'Jawa Tengah',
      'Jawa Timur',
      'Kalimantan Barat',
      'Kalimantan Selatan',
      'Kalimantan Tengah',
      'Kalimantan Timur',
      'Kalimantan Utara',
      'Kepulauan Bangka Belitung',
      'Kepulauan Riau',
      'Lampung',
      'Maluku',
      'Maluku Utara',
      'Nusa Tengga     ra Barat',
      'Nusa Tenggara Timur',
      'Papua (Irian Jaya)',
      'Papua Barat',
      'Riau',
      'Sulawesi Barat',
      'Sulawesi Selatan',
      'Sulawesi Tengah',
      'Sulawesi Tenggara',
      'Sulawesi Utara',
      'Sumatera Barat',
      'Sumatera Selatan',
      'Sumatera Utara',
      'Yogyakarta'
    ]
  }
}
>>>
Package: django-addthis
django-addthisA simple integration of theAddThissocial sharing widget forDjangoprojects.Authored byRaymond Wanyoike, and some greatcontributors.InstallationFirst install the module, preferably in a virtual environment. It can be installed from PyPI:pipinstalldjango-addthisSetupYou’ll need to addaddthistoINSTALLED_APPSin your project’ssettings.pyfile:INSTALLED_APPS+=['addthis',]ConfigurationTheaddthis_widgettemplate tag requires a siteprofile id:pub_id. Either pass it aspub_id, or setPUB_IDin yourADDTHIS_SETTINGSsettings dictionary:ADDTHIS_SETTINGS={'PUB_ID':'xx-xxxxxxxxxxxxxxxx',...}The siteprofile idcan be found by visiting its Profile Options page onAddThis(ID:).There are a fewconfiguration optionsforaddthisthat can be placed in yourADDTHIS_SETTINGSsettings dictionary:OptionDefaultUSERNAMESERVICES_EXCLUDESERVICES_COMPACTSERVICES_EXPANDEDSERVICES_CUSTOMUI_CLICKFalseUI_DELAY0UI_HOVER_DIRECTION0UI_LANGUAGEUI_OFFSET_TOP0UI_OFFSET_LEFT0UI_HEADER_COLORUI_HEADER_BACKGROUNDUI_COBRANDUI_USE_CSSTrueUI_USE_ADDRESSBOOKFalseUI_508_COMPLIANTFalseDATA_TRACK_CLICKBACKTrueDATA_GA_TRACKERPlease see theexampleapplication. This application is used to
manually test the functionalities of this package. This also serves as
a good example.You need Django 1.8 or above to run that. It might run on older versions but that is not tested.UsageFirst of all, load theaddthisin every template where you want to use it:{%loadaddthis%}then load the widget:{%addthis_widget%}Visit the AddThisGet the Codepage and create/generate your social sharing code, e.g:<!-- Go to www.addthis.com/dashboard to customize your tools --><divclass="addthis_sharing_toolbox"></div>Be sure to omit the:<scripttype="text/javascript"src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xx-xxxxxxxxxxxxxxxx"></script>part of the (generated) code as theaddthis_widgettemplate tag takes care of this.Example{%loadaddthis%}<!DOCTYPE html><html><head><metacharset="utf-8"><title>django-addthis Example</title></head><body><!-- Go to www.addthis.com/dashboard to customize your tools --><divclass="addthis_sharing_toolbox"></div><p>Well, the way they make shows is, they make one show. That show's
  called a pilot. Then they show that show to the people who make shows,
  and on the strength of that one show they decide if they're going to
  make more shows. Some pilots get picked and become television programs.
  Some don't, become nothing. She starred in one of the ones that became
  nothing.</p><!-- Placed at the end of the document so the page load faster -->{%addthis_widget%}</body></htmlContributingIf you’ve found a bug, implemented a feature or customized the template and
think it is useful then please consider contributing. Patches, pull requests or
just suggestions are welcome!Licensedjango-addthisis released under the GNU GPL v3 license.
Package: django-addview
What it does?Can’t remember Class-Based-Views parameters? Are you tired of
reiterating the same mundane steps while adding a new view? Trydjango-addview.How it works?Django-addview provides you with a simple ncurses based gui to add new
class-based or functional view.Creates class declaration (fill needed parameters, select a model
from the dropdown etc.)Remembers all class-based attributes for youCreates template (empty, or copied from existing one)Adds entry tourls.pyCares about all importsInstallationpip install django_addviewAnd add to settings.py:INSTALLED_APPS = (
    ...
    'django_addview',
)Usage./manage.py addview app_nameRemember:What you type inside app is what you get inside your code,
so if you want to have a string you have to quote it. For example:template_name       "test_app/my_view.html"ConfigurationDjango-addview expects only one config variable. It’s :ADDVIEW_GLOBAL_TEMPLATE_DIR = ...which points to directory where
you keep your project templates (It’s good practice to keep templates
inside one directory per project unless you write reusable app).Django-addview can create your views in two locations. One isADDVIEW_GLOBAL_TEMPLATE_DIRand second istemplatesdirectory
inside your apps directory. You choose between them while adding view in
gui.Example of configuration:SITE_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
ADDVIEW_GLOBAL_TEMPLATE_DIR = os.path.join(SITE_ROOT, 'templates')Screenshots
Package: django-adhara
Adhara in sanskrit meaning base/foundation, is a foundation for using Django as a Rest API provider.
Not just as a rest API provider, but much more.
Adhara handles sessions over Django sessions, events to fire to Android, Web, IOS, etc.
Also Adhara provides abstract models that can be extended to implementing apps to provide full REST API support.Detailed documentation is in the “docs” directory.Quick startAdd “adhara” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'adhara',
]Include the polls URLconf in your project urls.py like this:url(r'^adhara/', include('adhara.urls')),Run the following command to create the adhara Event models.:python manage.py migrate
Package: django-admin
django-adminDjango Admin ExtensionsInstallationpipinstalldjango-adminUsageDisable Actionfromdjango.contribimportadminfromdjango_adminimportDeleteModelAdmin# Override ``delete_selected``, call ``delete_model`` for each when ``delete_selected``classXXXAdmin(admin.ModelAdmin,DeleteModelAdmin):defdelete_model(self,request,obj):obj.delete()# Other Codes# Reopen action ``delete_selected`` after ``admin.site.disable_action('delete_selected')``classYYYAdmin(admin.ModelAdmin):actions=['delete_selected']# Disable ``actions``classZZZAdmin(admin.ModelAdmin):actions=NoneExport Excelfromdjango.contribimportadminfromdjango_adminimportExportExcelModelAdmin,AdvancedExportExcelModelAdminclassXXXAdmin(ExportExcelModelAdmin,admin.ModelAdmin):passclassYYYAdmin(AdvancedExportExcelModelAdmin,admin.ModelAdmin):excel_headers=()excel_fields=()excel_fields_exclude=()extra_excel_fields=()defadd_extra_excel_fields(self,request,query):return[]All Fields Readonlyfromdjango.contribimportadminfromdjango_adminimportReadonlyModelAdmin,Readonly2ModelAdminclassXXXAdmin(ReadonlyModelAdmin,admin.ModelAdmin):""" Readonly for Update. """passclassXXXAdmin(Readonly２ModelAdmin,admin.ModelAdmin):""" Readonly for Add/Update. """passDisable Editingfromdjango.contribimportadminfromdjango_adminimportReadOnlyModelAdminclassXXXAdmin(ReadOnlyModelAdmin,admin.ModelAdmin):passShould adddjango_admininINSTALLED_APPSINSTALLED_APPS=[...'django_admin',...]Disable Add/Deletefromdjango.contribimportadminfromdjango_adminimportChangeOnlyModelAdminclassXXXAdmin(ChangeOnlyModelAdmin,admin.ModelAdmin):passDisable Add/Changefromdjango.contribimportadminfromdjango_adminimportDeleteOnlyModelAdmin,DeleteonlyModelAdminclassXXXAdmin(DeleteOnlyModelAdmin,admin.ModelAdmin):# DeleteOnlyModelAdmin - All Fields Default Readonly# DeleteonlyModelAdmin - All Fields Not Default ReadonlypassShould adddjango_admininINSTALLED_APPSINSTALLED_APPS=[...'django_admin',...]Disable Delete/Changefromdjango.contribimportadminfromdjango_adminimportAddOnlyModelAdminclassXXXAdmin(AddOnlyModelAdmin,admin.ModelAdmin):passShould adddjango_admininINSTALLED_APPSINSTALLED_APPS=[...'django_admin',...]DisadvantageWill disabledelete_selectedfor allModelAdminWill lost delete confirm
Package: django-admin-508
django-admin-508django-admin-508is a responsive interface that aims to be accessible to the 508 Standard.FeaturesInstallationRunpip install django-admin-508Addadmin_interface,flat_responsive,flatandcolorfieldtosettings.INSTALLED_APPSbeforedjango.contrib.adminINSTALLED_APPS=(#...'admin_interface','flat_responsive',# only if django version < 2.0'flat',# only if django version < 1.9'colorfield',#...'django.contrib.admin',#...)# only if django version >= 3.0X_FRAME_OPTIONS='SAMEORIGIN'SILENCED_SYSTEM_CHECKS=['security.W019']Runpython manage.py migrateRestart your application serverUpgradeRunpip install django-admin-508 --upgradeRestart your application serverPublishing Updateshttps://packaging.python.org/tutorials/packaging-projects/https://realpython.com/installable-django-app/python3 -m pip install --upgrade build
python3 -m build


python3 -m pip install --upgrade twine
python3 -m twine upload --repository testpypi dist/*python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python makemigrations.pyIn da508clear the dist dirincrement versionbuildtwine uploadIn TDRSbackend:dc updocker compose run web python -m pipenv install django-admin-508==0.0.8local developmentcreate empty django projectcreate venvbuildpackage in another directorypip install -e /path/to/508migrateLicenseReleased underMIT License.See alsoThis project started out as a fork of the excellentDjango Admin Interface.
Package: django-adminactions
django-adminactionsCollection of useful actions to use with
django.contrib.admin.ModelAdmin and/or django.contrib.admin.AdminSitePlease see the changelog athttp://django-adminactions.readthedocs.org/en/latest/changes.htmlActionsExport as CSVExport as ExcelExport as fixtureExport delete treeMass update recordsGraph querysetMerge recordsFind DuplicatesBulk UpdateProject LinksCode:https://github.com/saxix/django-adminactionsDocumentation:https://django-adminactions.readthedocs.org/en/latest/Issue Tracker:https://github.com/saxix/django-adminactions/issues?sortDownload Package:https://pypi.org/project/django-adminactions/
Package: django-admin-actions
django-admin-actionsdjango-admin-actions provides simple way how to define custom actions for Django admin changelist, changeview and per row in changelist.Getting startedInstallationpipinstalldjango-admin-actionspipinstallgit+https://git@github.com/lukasvinclav/django-admin-actions.gitAddadmin_admin_actionsintoINSTALLED_APPSin your settings file beforedjango.contrib.admin.Sample admin configurationfromdjango.contribimportadminfromdjango.shortcutsimportredirectfromdjango.urlsimportreverse_lazyfromdjango.utils.translationsimportugettext_lazyas_fromadmin_actions.adminimportActionsModelAdminfrom.modelsimportExampleModel@admin.register(ExampleModel)classCustomAdmin(ActionsModelAdmin):actions_list=('custom_list_action',)actions_row=('custom_row_action',)actions_detail=('custom_detail_action',)defcustom_list_action(self,request):# custom logic herereturnredirect(reverse_lazy('admin:APP_MODEL_changelist'))custom_list_action.short_description=_('Custom name')custom_list_action.url_path='clean-url-path-1'defcustom_row_action(self,request,pk):# custom logic herereturnredirect(reverse_lazy('admin:APP_MODEL_changelist'))custom_row_action.short_description=_('Row custom name')custom_row_action.url_path='clean-url-path-2'defcustom_detail_action(self,request,pk):# custom logic herereturnredirect(reverse_lazy('admin:APP_MODEL_changelist'))custom_detail_action.short_description=_('Detail custom name')custom_detail_action.url_path='clean-url-path-3'
Package: django-adminactions-ptbr
Collection of useful actions to use with
django.contrib.admin.ModelAdmin and/or django.contrib.admin.AdminSitePlease see the changelog athttp://django-adminactions.readthedocs.org/en/latest/changes.htmlActionsExport as CSVExport as ExcelExport as fixtureExport delete treeMass update recordsGraph querysetMerge recordsProject linksStableDevelopmentProject home page:https://github.com/saxix/django-adminactionsIssue tracker:https://github.com/saxix/django-adminactions/issues?sortDownload:http://pypi.python.org/pypi/django-adminactions/Documentation:https://django-adminactions.readthedocs.org/en/latest/
Package: django-admin-additions
There are a few things about the django admin that get me down. Here are solutions to
those, all bundled up together.InstallationAdd'admin_additions'to yousettings.INSTALLED_APPS.Then configure the additions you want to use. The default settings are shown:ADMIN_ADDITIONS = {
    'RETURN_TO_FILTERED_CHANGELIST': False,
    'SAVE_ON_TOP': True,
    'LIST_SELECT_RELATED': False,
    'FULLY_DYNAMIC_FORMSETS': True
}SettingsRETURN_TO_FILTERED_CHANGELISTWhen editing an object, you usually want to revert back to the filtered view
from whence you came.This is a monkey-patch that supplements the normalchange_viewmethod on theModelAdminbase class, and ensures that it returns after a POST back to the
referring view.This method of returning to the filtered view after submitting a form in an admin
change view is based largely uponSnippet 2531 <http://djangosnippets.org/snippets/2531/>.SAVE_ON_TOPShould be the default: display the save toolbar on the top of everychange_view.LIST_SELECT_RELATEDTurn on automatic.select_related()for all queries for a change_list. If you have
altered the display columns, and do any lookups at all, this is a good idea.FULLY_DYNAMIC_FORMSETSSets theextravalue onInlineModelAdminto 0, so you just use the addition button
instead of having any empty formsets.Patching functionspatch_model_admin(model, patch_function)Patch an installedModelAdmin. This includes unregistering, patching and then re-registering. You may pass in a model, or a string of the form“app_label.ModelName”, and a function that will take and patch aModelAdminclass.If you create a new class based on the passed in class, then you may return it: that will then be used within the re-registration. If you simply patch the existing class, you can return nothing, and the patched original class will be used.from admin_additions.patchers import patch_model_admin

def patcher_function(model_admin):
    # Do stuff here.
    model_admin.form = MyClassyForm
    return model_admin # optional: you may patch in-place

patch_model_admin(MyModel, patcher_function)add_inlines(model, *inlines)A simple/common case of patching aModelAdmin- adding a new inline:from django.contrib import admin
from admin_additions.patchers import add_inlines

from models import Foo

class FooInline(admin.StackedInline):
    model = Foo

add_inlines('bar.Bar', FooInline)You may pass multiple inlines.You may also pass in any combination of models or admin inlines: if a model is received, it will create aStackedInlinefor that model.add_actions(model, *actions)Like for inlines, but add an action.@patch_admin(model)A decorator, that can decorate a function to be patched.from admin_additions.patchers import patch_admin

@patch_admin(model)
def patcher_function(model_admin):
    model_admin.form = MyClassyFormThis syntax is terser than thepatch_model_adminfunction above.
Package: django-admin-anchors
Django Admin AnchorsTurn Django admin list display items into clickable links to related
objects using decorators.Clicking admin anchors will redirect to a filtered changelist view
showing the related objects. This allows you to get a quick overview
and run actions on the filtered objects.Installationpip install django-admin-anchorsUsageTake a look at thetests/projectdirectory to see a runnable example project.Add links to the object list pagefromdjango.contribimportadminfromadmin_anchorsimportadmin_anchorfromyourapp.modelsimportTeam@admin.register(Team)classTeamAdmin(admin.ModelAdmin):list_display=["__str__","captain_link","captains_profile_link","members_link"]@admin_anchor("captain")defcaptain_link(self,instance):returnstr(instance.captain)@admin_anchor("captain.profile")defcaptains_profile_link(self,instance):return"Captains profile"@admin_anchor("members")defmembers_link(self,instance):returnf"{instance.members.count()}members"Add links to the object update pagefromdjango.contribimportadminfromadmin_anchorsimportadmin_anchorfromyourapp.modelsimportPlayer@admin.register(Player)classPlayerAdmin(admin.ModelAdmin):readonly_fields=["profile_link"]@admin_anchor("profile")defprofile_link(self,instance):return"Profile"Example projectTake a look at our Django example project undertests/project.
You can run it by executing these commands:poetry installpoetry run python tests/project/manage.py migratepoetry run python tests/project/manage.py runserver
Package: django-admin-anylogicfilter
django-admin-anylogicfilterDjango app that adds admin filter with any functionality you need.RequirementsApp tested withPython 3.11Django 4Installationpipinstalldjango-admin-anylogicfilterQuick startAdd anylogicfilter to INSTALLED_APPS:INSTALLED_APPS=[...'anylogicfilter',...]Declare your filter class by inheriting fromAnyLogicFilterclass:fromdjangoimportformsfromanylogicfilter.filterimportAnyLogicFilterclassMyFilter(AnyLogicFilter):filter_title='Abracadabra'filter_fields=[('field_name',forms.CharField(max_length=100,required=True,initial='')),('other_field_name',forms.BooleanField(label='Not default by-name label',required=False,initial='')),]defqueryset(self,request,queryset):ifself.form.is_valid():filter_params={p:self.form.cleaned_data.get(p)forpinself.expected_parameters()ifself.form.cleaned_data.get(p)isnotNone}# some query, using subquery with 2+ parameters or anything else you needreturnqueryset.filter(...filter_params['field_name']...filter_params['other_field_name']...)else:returnquerysetAdd it toadmin.py:@admin.register(YourModel)classYourModelAdmin(admin.ModelAdmin):list_filter=[...('name_of_any_field_from_or_related_to_your_model',MyFilter),...]Enjoy!MaintainersMaxim MedentsevIvan GolyshevContributingBug reports and/or pull requests are welcome :)LicenseMIT License
Package: django-admin-api
简体中文 |Englishdjango-admin-apiDjango Admin 前后端分离框架体验登录账号：demo / demo体验网站（PC端)(antd版本)：http://antd.nieoding.ml体验网址（PC端)(element版本):http://element.nieoding.ml体验网址（移动端）-- 手机扫码：版本要求Python (3.5, 3.6, 3.7, 3.8, 3.9)Django (2.2, 3.0, 3.1, 3.2)第一步: 安装使用pip安装...pip install django-admin-api第二步: 创建一个简单项目django-adminstartprojectexamplecdexample
./manage.pymigrate
./manage.pycreatesuperuserINSTALLED_APPS加入如下依赖.# example/settings.pyINSTALLED_APPS=[...'rest_framework','django_filters','admin_api',]第三步: 输出API接口# example/urls.py...importadmin_apiurlpatterns=[...path('api/',admin_api.site.urls),]前端框架列表框架设备项目ant-design(vue)桌面端antd-djangoelement(vue)桌面端element-djangovant(vue)移动端vant-django后端项目创建完成以后，移步到前端框架项目中...
Package: django-admin-appmenu
django-admin-appmenuprovides a templatetag that renders an application
menu in theDjangoadmin.InstallationUsepipto install the download and install the package fromPyPi:pip install django-admin-appmenuOr checkout the source code fromGithub:git clone https://github.com/collab-project/django-admin-appmenu.git
cd django-admin-appmenu
pip install -e .Addadmin_appmenutoINSTALLED_APPSin your Django project settings:INSTALLED_APPS=(...'admin_appmenu',)UsageOverridetheadmin/base.htmltemplate and make the tag available in the
template:{%loadnavigation%}Now add theadmin_navigationtag to the template:{%admin_navigation%}After reloading the admin you will see the new menu.To customize the output of the tag create and customize a copy of theadmin_appmenu/navigation.htmltemplate.Custom admin siteBy default the standard Django admin site (django.contrib.admin.site)
is used to build the menu tree. If your project uses acustomized admin siteset theADMIN_APPMENU_CLASSsetting to the path of the custom admin site
instance.For example insettings.py:ADMIN_APPMENU_CLASS='myapp.admin.admin_site'This also allows you tosort and formatthe applications list used to render
the menu.
Package: django-admin-app-names-singleton
=====Translate app names and allow singletons=====This is a simple Django app to enable translation of app names inDjango admin and allow the use of singletons.When an object is marked as a singleton only one instance will be allowed to exist.Detailed documentation is in the "docs" directory.Quick start-----------1.  Add "django_singleton_app_name" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'django_singleton_app_name',)2.  Copy templates from django-admin-app-names-singleton/templatesto your project's template directory.All app names will now be translated when possible.In order to add app names to .po files via "makemessages"create a python file "app_names.py" next to your "settings.py" fileand paste the following import into it:"from django.utils.translation import ugettext_lazy as _".For each app you want to mark for translation add a line such as the following:_("<app_name>")Example:_("auth")3.  To mark a model as a singleton you must subclass that model from"django_singleton_app_name.models.SingletonBaseModel"And create a ModelAdmin for that model that subclasses"django_singleton_app_name.admin.SingletonModelAdmin"and overwrite the ModelAdmin's member "model" with the Model's classExample:class ContactInformation(SingletonBaseModel):address = models.CharField(max_length=65)email = models.EmailField()class ContactInfoAdmin(SingletonModelAdmin):model = ContactInformation