django-filebrowser 'Error finding Upload-Folder'
Asked Answered
L

1

9

I have:

  • Django 1.8.2
  • django-grappelli 2.7.3
  • django-filebrowser 3.6.4
  • django-tinymce 2.4.0

In INSTALLED_APPS:

INSTALLED_APPS = (
    'grappelli',
    'filebrowser',
    'django.contrib.admin',

In urlpatterns:

from filebrowser.sites import site

urlpatterns = patterns[
   url(r'^admin/filebrowser/', include(site.urls)),
   url(r'^grappelli/', include('grappelli.urls')),
   url(r'^tinymce/', include('tinymce.urls')),
   url(r'^admin/', include(admin.site.urls)),
]

Which seems to work correctly.

My MEDIA_ROOT is set to 'D:\\sites\\my_site\\public_html\\media\\'.

I have FILEBROWSER_DIRECTORY = 'D:\\sites\\my_site\\public_html\\media\\' set also in my settings, but still getting an error on browsing http://localhost:8000/admin/filebrowser/browse/:

ImproperlyConfigured at /admin/filebrowser/browse/

Error finding Upload-Folder (site.storage.location + site.directory). Maybe it does not exist?
Lincolnlincolnshire answered 14/1, 2017 at 16:47 Comment(0)
L
25

The thing is DIRECTORY is set in filebrowser.settings by default to uploads/. So just did

FILEBROWSER_DIRECTORY = ''
DIRECTORY = ''

in my settings and now it works using MEDIA_ROOT as I was expexting.

Or one just can create uploads directory inside MEDIA_ROOT to make it work.

Lincolnlincolnshire answered 14/1, 2017 at 17:0 Comment(2)
Thank you. It was pain to set this thing. For me now (django-filebrowser==3.11.1) it works with FILEBROWSER_DIRECTORY= setting only (="" or =".", but not ="/"), I don't need DIRECTORY=.. But because MEDIA_ROOT is used for uploads from FileField's inside the admin, it is better for me to create a separate directory like FILEBROWSER_DIRECTORY="dashboard_uploads/".Duaneduarchy
I think, the DIRECTORY setting has no effect. And in my case, it was that media directory wasn't created at all, and I had to add it.Panathenaea

© 2022 - 2024 — McMap. All rights reserved.