Table of Contents
Django Filebrowser #
Django is big framework. It has very useful features, such as, built-in administration, database migration, site management, content type management and others. Some Django projects may need to have file-manager for managing static files on server side. Unfortunately, Django does not provide file-manager for uploaded or statically served files by default. For this purpose, there had been several open-source projects to fulfill this empty place.
One of the actively developing open-source project is
django-filebrowser. It has been developing by Patrick Kranzlmueller, who is the author of famous
django-grapelli package. It is more decent and stable version among the other file-managers. It also has full documentation.
django-filebrowser has following features:
- browse directories on your server and upload/delete/edit/rename files
- include images/documents to your models/database using the FileBrowseField
- select images/documents with TinyMCE
- Django 1.9 (http://www.djangoproject.com)
- Grappelli 2.8 (https://github.com/sehmaschine/django-grappelli)
- Pillow (https://github.com/python-imaging/Pillow)
Intallation is super-easy with
$ pip install django-filebrowser
Add the filebrowser to your
#!python INSTALLED_APPS = ( 'grappelli', 'filebrowser', 'django.contrib.admin', )
Add the FileBrowser site to your url-patterns (before any admin-urls):
#!python from filebrowser.sites import site urlpatterns = [ url(r'^admin/filebrowser/', include(site.urls)), url(r'^grappelli/', include('grappelli.urls')), url(r'^admin/', include(admin.site.urls)), ]
Collect the static files:
$ python manage.py collectstatic --noinput
You need to add a folder “uploads” within
site.storage.location when using the default settings.
Start the devserver and login to your admin site:
python manage.py runserver <IP-address>:8000
/admin/filebrowser/browse/ and check if everything works as expected.