Jalali date support for Django Jazzmin admin with rangefilter
Project description
Django Jazzmin Admin RangeFilter Jalali Plus
✨ A complete Jalali range filter integration for Django Admin with Jazzmin +
django-jalali-date
🌐 English (Informal)
When you're building a Django app in Persian (Farsi), date filtering can be a real headache. Django by default stores and works with Gregorian (Miladi) dates. But for your users, you probably want to display Jalali (Shamsi) dates — with a Persian datepicker, too.
The best package (in my opinion) for working with Jalali in Django is:
📦 django-jalali-date
But there was still a big problem: If you're using Jazzmin Admin theme and you want a clean range filter (between two dates) for a Jalali date field — it just didn’t work.
Until now! 😉
This package fixes that problem. Just install it and you'll get a beautiful, working Jalali range filter inside the Jazzmin-styled Django Admin panel.
✅ Features
- Fully compatible with
django-jalali-date - Works perfectly with Jazzmin theme
- Clean Persian datepicker (no JS setup needed)
- Supports inline date range filtering in the admin
- Pure plug-and-play
🚀 Installation
pip install django-jalali-date
pip install django-jazzmin
pip install django-jazzmin-admin-rangefilter-jalali-plus
Add 'jalali_date' and 'rangefilter2' to INSTALLED_APPS after 'jazzmin' and 'django.contrib.admin'.
Make sure your Django is localized to Persian (Farsi) and supports fa-IR.
🛠️ Usage
# admin.py
from rangefilter2.jalali_date_range_filter import JalaliDateRangeFilter
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
list_filter = [
('date', JalaliDateRangeFilter),
]
⚠️ Don’t forget to collect static files:
python manage.py collectstatic
Then just run your project:
python manage.py runserver
And enjoy your brand-new Jalali Date Range Filter in the Admin panel 😍
🇮🇷 فارسی
وقتی از جنگو برای پروژههای فارسی استفاده میکنیم، یکی از چالشهای جدی ما تاریخ هست.
تاریخ بهصورت استاندارد در پایگاه داده میلادی ذخیره میشه، اما کاربرهای ما انتظار دارن تاریخ شمسی (جلالی) ببینن، اونم با دیتاپیکر فارسی و شمسی.
محبوبترین و بهترین پکیجی که تا امروز برای این کار هست، بیشک:
📦 django-jalali-date
اما یه مشکلی هست:
وقتی از پنل ادمین Jazzmin استفاده میکنیم و میخوایم یه فیلتر بازهای (RangeFilter) برای تاریخ شمسی داشته باشیم، معمولاً به مشکل میخوریم.
🎉 این پکیج دقیقاً همون مشکلو حل میکنه!
📦 نصب پکیجها
pip install django-jalali-date
pip install django-jazzmin
pip install django-jazzmin-admin-rangefilter-jalali-plus
در settings.py اینها رو در INSTALLED_APPS بیار:
INSTALLED_APPS = [
'jazzmin',
'django.contrib.admin',
...
'jalali_date',
'rangefilter2',
]
🧪 استفاده در ادمین
# admin.py
from rangefilter2.jalali_date_range_filter import JalaliDateRangeFilter
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
list_filter = [
('date', JalaliDateRangeFilter),
]
✅ حالا فقط کافیه دستور collectstatic بزنی:
python manage.py collectstatic
و بعد پروژه رو اجرا کن و لذت ببر از یه فیلتر خطیِ شمسیِ بدون باگ توی ادمین جنگو ❤️
🖼️ Screenshot
screenshot:
📄 License
MIT License. See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_jazzmin_admin_rangefilter_jalali_plus-1.0.0.tar.gz.
File metadata
- Download URL: django_jazzmin_admin_rangefilter_jalali_plus-1.0.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d4feaf48d6764fe70ad364bd7893e9ddabeb88bad3bdd8e149ddc3b196f25dd
|
|
| MD5 |
b8a739b0e8ce62cc3bd46e3bca74495c
|
|
| BLAKE2b-256 |
b3a05abe5292b4ab9060ca470a90e06fcb69191ef2b81cb6bf9f3c13f84d84eb
|
File details
Details for the file django_jazzmin_admin_rangefilter_jalali_plus-1.0.0-py3-none-any.whl.
File metadata
- Download URL: django_jazzmin_admin_rangefilter_jalali_plus-1.0.0-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afed7b813d438b745d40bcd1063d8b4f685e6268ca7d83a5016c86c75bb688e1
|
|
| MD5 |
2912845344e5731d613b1fa96b8ce1c6
|
|
| BLAKE2b-256 |
ed40fa7d310590a5d5e0320395fe4a70f960bd21aa2525319238416205b449c4
|