
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
django-lazy-admin-pagination
Advanced tools
A Django package for lazy-loading pagination in the admin interface.
Here's a comprehensive guide for using the django-lazy-admin-pagination
package, including installation, setup, and usage. This documentation can be added to your README.md
or used as a separate documentation file.
django-lazy-admin-pagination is a Django package designed to provide lazy-loading pagination for Django's admin interface. It enhances user experience by loading total counts asynchronously and updating pagination dynamically, improving performance on large datasets.
You can install the package directly from GitHub or PyPI:
Install from GitHub:
pip install git+https://github.com/anish5256/django-lazy-admin-pagination.git
INSTALLED_APPS
Add django_lazy_admin_pagination
to the INSTALLED_APPS
list in your Django project's settings.py
file:
INSTALLED_APPS = [
...,
'django_admin_lazy_count',
]
LazyLoadPaginationMixin
In your admin.py
, modify your model admin class to include LazyLoadPaginationMixin
.
from django.contrib import admin
from django_admin_lazy_count.main import LazyLoadPaginationMixin
from .models import YourModel
@admin.register(YourModel)
class YourModelAdmin(LazyLoadPaginationMixin, admin.ModelAdmin):
list_per_page = 100 # Customize the number of items per page as needed
Here's an example admin.py
configuration for a Django project using the package:
# admin.py
from django.contrib import admin
from django_lazy_admin_pagination.main import LazyLoadPaginationMixin
from .models import Product
@admin.register(Product)
class ProductAdmin(LazyLoadPaginationMixin, admin.ModelAdmin):
list_display = ('name', 'price', 'stock')
search_fields = ('name', 'description')
list_filter = ('category',)
list_per_page = 50
LazyLoadPaginationMixin
: This mixin adds lazy-loading pagination functionality to the admin class.list_per_page
: Specifies the number of items displayed per page. Adjust this value as needed.Contributions are welcome! If you'd like to contribute:
This project is licensed under the MIT License.
For any issues or questions, please submit a ticket on the GitHub issues page.
FAQs
A Django package for lazy-loading pagination in the admin interface.
We found that django-lazy-admin-pagination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.