I'm having an issue with Django-Filebrowser when I try to upload an image. I'm using the following versions: Django 1.8.7, Filebrowser 3.6.4 and Python 2.7.
When I try to upload an image, everything works as expected, and the uploaded files are placed in the right folder without any problem; but the resultant file url doesn't have any leading slash necessary to serve properly the file.
For example, if I try to upload "test.jpg", the final image url will be "uploads/test.jpg" and "_versions/test_xxx.jpg" that actually creates issues even in the Filebrowser panel, since the resulting request will be issued to http://localhost:8000/admin/filebrowser/browse/uploads/test.jpg
and http://localhost:8000/admin/filebrowser/browse/_versions/test.jpg
rather than http://localhost:8000/uploads/test.jpg
and http://localhost:8000/_versions/test.jpg
that the server would serve properly.
(Note that the Filebrowser panel url is http://localhost:8000/admin/filebrowser/
)
Here's my settings:
urls.py:
urlpatterns = [
url(r'^admin/filebrowser/', include(site.urls)),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('pages.urls')),
url(r'^blog/', include('articles.urls')),
url(r'^tinymce/', include('tinymce.urls')),
url(r'^grappelli/', include('grappelli.urls')),
]
settings.py
FILEBROWSER_DIRECTORY = 'uploads/'
FILEBROWSER_VERSIONS_BASEDIR = '_versions/'
Add a leading slash to the FILEBROWSER_DIRECTORY
would trigger a SouspiciusFileOperation error since '/uploads/' is located outside the project folder.
Thanks in advance.