django-filer is an active file management application for Django that simplifies handling of files and images within Django projects. It provides a robust file browser and model fields for seamless integration. The current version is 3.4.4, and the library maintains an active release cadence with frequent updates and patches.
pip install django-filerVerified import paths — ran on the pinned version, not inferred.
To get started with django-filer, install the package, add `filer`, `easy_thumbnails`, `mptt`, and `polymorphic` (if not already present) to your `INSTALLED_APPS` in `settings.py`, and define `MEDIA_ROOT` and `MEDIA_URL`. Then, run migrations. You can then use `FilerImageField` or `FilerFileField` in your Django models, similar to Django's native `ImageField` and `FileField`. Remember to specify an `on_delete` parameter for these fields.
Run `python manage.py makemigrations filer` and `python manage.py migrate` after upgrading. Review `FILER_FILE_VALIDATORS` settings if you need to allow specific file types. Refer to official upgrade instructions.
To explicitly allow binary files, add `FILER_REMOVE_FILE_VALIDATORS = ['application/octet-stream']` to your `settings.py`. Consider implementing virus scanning for uploaded files.
Ensure that a standard, visible field (e.g., `CharField`) precedes any `FilerFileField` or `FilerImageField` in your admin `fieldsets` or `fields` configuration.
Review your `FolderAdmin` customizations if you encounter unexpected sorting. You might need to override `get_ordering` or similar methods, or contribute to `django-filer` to address the underlying issue.