Giter VIP home page Giter VIP logo

django-filebrowser's Introduction

Django FileBrowser

https://github.com/sehmaschine/django-filebrowser/actions/workflows/tests.yml/badge.svg?branch=master https://readthedocs.org/projects/django-filebrowser/badge/?version=latest

Media-Management with Grappelli.

The FileBrowser is an extension to the Django administration interface in order to:

  • 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.

Requirements

FileBrowser 4.0.3 requires

Documentation

http://readthedocs.org/docs/django-filebrowser/

Translation

https://www.transifex.com/projects/p/django-filebrowser/

Releases

  • FileBrowser 4.0.3 (July 27th, 2023): Compatible with Django 4.0
  • FileBrowser 3.14.3 (January 12th, 2022): Compatible with Django 3.2 (LTS)

Current development branches:

  • FileBrowser 4.0.4 (Development Version for Django 4.0, see Branch Stable/4.0.x)
  • FileBrowser 3.14.4 (Development Version for Django 3.2, see Branch Stable/3.14.x)

Older versions are available at GitHub, but are not supported anymore.

django-filebrowser's People

Contributors

adamrt avatar ankhbayar avatar bessl avatar cuchac avatar dheerosaur avatar fetzig avatar fgmacedo avatar havardox avatar honi avatar igorsobreira avatar jkanaet avatar jxnl avatar kanu avatar kevin1024 avatar kidwind avatar laat avatar lk-geimfari avatar lnmichal avatar michalwerner avatar parsch avatar sebassbm avatar sehmaschine avatar timgraham avatar tomassommar avatar willharris avatar xavitorello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-filebrowser's Issues

Internet Explorer Failing on Upload

I am using django-filebrowser 3.4.1 with django 1.3.1 and grappelli 2.3.6 that is using tinymce 3.4.2

Everytime I try to upload a file using filebrowser on Internet Explorer 9, 8, or 7 I get a message of "Failed" but the upload works fine (with the same file) on FireFox 8.0

FireFox call:
"POST /admin/filebrowser/upload_file/?csrf_token=e8d0b5d2e918188b66cfcfb0cebd9e79&csrf_name=csrfmiddlewaretoken&csrf_xname=X-CSRFToken&folder=&qqfile=001_05.png HTTP/1.1" 200 43

Internet Explorer call:
"POST /admin/filebrowser/upload_file/?csrf_token=682d458c6130355f60d38ff9382c03e9&csrf_name=csrfmiddlewaretoken&csrf_xname=X-CSRFToken&folder= HTTP/1.1" 500 88339

The 500 error that I get is:
Exception Value: 'NoneType' object has no attribute 'replace'
..\ext\filebrowser\sites.py in _upload_file line 495

I did a 'print request.POST.get('file_name')' and got 'None' in the console when using IE

When I try to do a 'manage.py test filebrowser' I get this error:

FAIL: runTest (filebrowser.tests.sites.TestSite_filebrowser)

Traceback (most recent call last):
File "..\ext\filebrowser\tests\sites.py", line 232, in runTest
test_detail(self)
File "..\ext\filebrowser\tests\sites.py", line 139, in test_detail
test.assertTrue(test.site.storage.exists(path))
AssertionError: False is not true


'print path' returns the correct path for three files:
tmp_test_0\testimage_large.jpg
tmp_test_0\testimage_admin_thumbnail.jpg
tmp_test_0\testimage_project_image.jpg

'print test.site.storage.exists(path)' returns:
True
True
False

version doesn´t work with image.path

I´m not sure we´ve decided for that decision, but it doesn´t seem to be possible anymore to generate a version based on image.path (you need to use image instead). which is also true for e.g. the fileinput-widget.

Incorrect URL after selecting an image for FileBrowseField

To invoke the bug:

  1. Click the search icon of an FileBrowseFieldForm
  2. Select an image
  3. Click on the thumbnail of the image before you save the change

Result: In my case, I get a 404 error for a page: http://127.0.0.1:8000/admin/blog/article/3/uploads/Pics/title_photo.jpg. You can see that the relative URL "uploads/Pics/title_photo.jpg" of the file gets appended to the admin URL and not to MEDIA_URL.

The cause of this bug is the javascript function FileSubmit() in FB_FileBrowseField.js which sets the href attribute of a preview link to a relative url of the given file.

Default settings show extensionless files as folders

Despite the documentation at
http://readthedocs.org/docs/django-filebrowser/en/latest/settings.html#extensions-and-formats
saying

EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", {
    'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'],
    'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'],
    'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
    'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p']
})

https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/settings.py
actually does

# Allowed Extensions for File Upload. Lower case is important.
EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", {
    'Folder': [''],
    'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'],
    'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'],
    'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
    'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p']
})

FileObject.filetype
https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/base.py#L214
will return 'Folder' if it's a directory, but if not determine from this dictionary. (The description "Allowed Extensions for File Upload" for this settings gives no hint about this other use)

At the same time,
https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/templates/filebrowser/include/filelisting.html
checks fileobject.filetype to see if it's a folder and show a Browse link in that case.

This leads to files that have no extension being shown as Folders, and clicking on them gives "Folder does not exist".

filelisting.html needs to check filobject.is_folder instead, which let's the storage's isdir() decide.
I don't think the 'Folder' type for an empty extension should be in the default settings either.

Syntax error in JS of uploads.html:95 locale=FR

Unescaped quote ( ' ) in i18n french cause syntax error in upload page, and french i18n unusable.
Error come from ' django-filebrowser / filebrowser / locale / fr / LC_MESSAGES / django.po' lignes 286 to 295 :

: templates/filebrowser/upload.html:60

msgid "{file} has invalid extension. Only {extensions} are allowed."
msgstr ""
"{file} n'a pas une extension valide. Seules les extensions suivantes sont "
"autorisées : {extensions}."
==> n'a

: templates/filebrowser/upload.html:61

msgid "{file} is too large, maximum file size is {sizeLimit}."
msgstr ""
"{file} est trop lourd, la taille maximale d'un fichier est {sizeLimit}"
==> d'un

Thanks for this great django-app and the fernch i18n anyway,
Regards,

Versions documentation and proper usage.

In the documentation here http://readthedocs.org/docs/django-filebrowser/en/latest/versions.html#versions-in-views

It says that in views you can generate/retrieve versions like so: obj.image.version(version_prefix) but it doesn't work. There is no method version(). There is versions() and version_name(). I can get the filename of the version via version_name(version_prefix) but its strictly the filename of that version. I need the full url.

This has been working in older versions of FB like this - obj.image.url_VERSION but this no longer works. After upgrading to 3.3 I began having this issue.

What is the proper way handle this?
Thanks man

thumbnail-preview design

this looks different if used with FileInput or ClearableFileInput. and there´s also differences between the form and inlineforms.

Uploads fail

Media files are served up correctly both on the frontend and via filebrowser. When I try to upload a ~10MB file, it fails. However, small images are uploaded just fine. My upload limit is 100+ MB.

Using the latest stable (via PyPI)

I'm happy to provide you with debugging data --- I just don't know where to look.

Thanks

Filebrowser Widget displays blank value

Hello,

We're using the filebrowser widget in an admin inline such that:

class Image(models.Model):
# ...
article = models.Foreignkey(Article)
image = FileBrowseField(
"Image file",
blank=False,
directory="images/",
max_length=200,
null=True,
help_text="Click thumbnail to view ful size image.")
# ....

When adding an 'attached' Image model, the following occurs:

  • adding an image is successful, i.e. click the filebrowser widget icon; insert an image; 'Save & continue editing'
  • upon reload, the image input appear blank -- despite its value being set

Save & Continue Editing

  • then, on resave again, a Validation error is raised:

Validation Error

reloading the article without save results in the same scenario as the first image.

In [1]: import filebrowser
In [2]: filebrowser.VERSION
Out[2]: '3.4.0'
In [4]: import grappelli
In [6]: grappelli.VERSION
Out[6]: '2.3.6'

if VERSIONS_BASEDIR not set then no versions

filebrowser 3.4.0 (pip install latest)

if the Setting FILEBROWSER_VERSIONS_BASEDIR is not set no versions are generated.
default seems not working. set to something all is ok

UnicodeEncodeError:

I'm not sure when exaclty this happens, but I'm guessing during upload of non-ascii filename.

Environment:

Request Method: POST
Request URL: http://www.inre.si/admin/filebrowser/check_file/

Traceback:
File "/srv/www.inre.si/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/srv/www.inre.si/eggs/Django-1.3.1-py2.7.egg/django/views/decorators/csrf.py" in wrapped_view
  2.     resp = view_func(_args, *_kwargs)
    
    File "/srv/www.inre.si/eggs/Django-1.3.1-py2.7.egg/django/views/decorators/csrf.py" in wrapped_view
  3.     return view_func(_args, *_kwargs)
    
    File "/srv/www.inre.si/src/django-filebrowser/filebrowser/views.py" in _check_file
  4.             if os.path.isfile(smart_unicode(os.path.join(MEDIA_ROOT, DIRECTORY, folder, v))):
    
    File "/srv/www.inre.si/lib/python2.7/genericpath.py" in isfile
  5.     st = os.stat(path)
    

Exception Type: UnicodeEncodeError at /admin/filebrowser/check_file/
Exception Value: ('ascii', u'/srv/www.inre.si/inrev2/media/uploads/obrazlo\u017eitev_seminarja_20.10.2011.pdf', 45, 46, 'ordinal not in range(128)')

Filebrowser doesn't respect the FILEBROWSER_MEDIA_ROOT setting

I am testing Filebrowser 3.4.1. Whatever I set to FILEBROWSER_MEDIA_ROOT, the shown path at the root position is settings.MEDIA_ROOT + FILEBROWSER_DIRECTORY.

For example, with the following settings

FILEBROWSER_MEDIA_ROOT = os.path.join(MEDIA_ROOT, "uploads")
FILEBROWSER_DIRECTORY = ""

I expect to browse the "uploads/" at the root position, but I get MEDIA_ROOT instead.

The following setup works

FILEBROWSER_MEDIA_ROOT = MEDIA_ROOT
FILEBROWSER_DIRECTORY = "uploads/"

but then the "uploads/" part is saved in the database for FileBrowseFields.

update docs

there are still links to googlecode - need to be replace with github.

file digging, potential issue

If read permissions are allowed outside uploads directory for the apache/server user, a user can dig files using relative links such as &dir=valid_directory/../../../../../

A patch might just add -- "if path.startswith('.') or '..' in path or ...", or convert the requested path to absolute and check against the absolute base directory. I don't know if it breaks any assumptions to lock a user to the UPLOADS though.

https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/functions.py

def get_path(path):
if path.startswith('.') or os.path.isabs(path) or not os.path.isdir(os.path.join(MEDIA_ROOT, DIRECTORY, path)):
return None
return path

Proposal: Add editable meta data fields to file details

Any thoughts on adding metadata fields to file details... Fields could be defined in settings... Title and Alternative Description would be particularly useful. Useful for accessibility, seo and various "slideshows" etc.

    <img src="{{ version_medium }}" title="{{ meta_title }}" alt="{{ meta_alt }}" />

Add User reference in FileObject

Hi,

I'm working on a django application to save files also in a git-annex repository to create distributed media repository. I'd like to integrate to django-filebrowser. Is there any idea to include some reference to the user in fileobject as a owner? I saw there was some people in the old issue tracking on google code that was looking for something similar.

Thanks,
Vince

Convert FileObject to FieldFile

I'm trying to use easy-thumbnails with django-filebrowser. In my model I have a FileBrowseField. Then in my template I'm loading the thumbnail template tag and passing the file tot it. Trouble is, FileBrowseField returns a FileObject, whereas thumbnail expects a FieldFile. (Or something like that - I'm a bit new to all this).

Is there a simple way to do this - allow an image to be added via a FileBrowseField in admin but return a conventional File object (not a FileObject!) in the template?

file default permission

I think:

settings.py line 107

Default Upload and Version Permissions

FB_DEFAULT_PERMISSIONS = getattr(settings, "FILEBROWSER_SEARCH_TRAVERSE", 0664)

Should be:

FB_DEFAULT_PERMISSIONS = getattr(settings, "FILEBROWSER_FB_DEFAULT_PERMISSIONS", 0664)

Thanks.

AttributeError: 'module' object has no attribute '_TextTestResult'

$ ./manage.py test filebrowser
Traceback (most recent call last):
  File "./manage.py", line 14, in <module>
    execute_manager(settings)
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 67, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django_pdb/management/commands/test.py", line 2, in <module>
    from django_pdb.testrunners import PdbTestSuiteRunner
  File "/home/artem/prog/dev/project/env/lib/python2.7/site-packages/django_pdb/testrunners.py", line 70, in <module>
    class PdbTestResult(ExceptionTestResultMixin, unittest._TextTestResult):
AttributeError: 'module' object has no attribute '_TextTestResult'

Versions feature could be refactored into an optional app

The versions feature is very useful, but some sites (specially high-traffic) will adopt other strategies for generating thumbnails, rendering filebrowser less useful than it could be. Some sites also have to deal with legacy media, and that doesn't play well with filebrowser's notion of "versions".

It would be interesting to decouple the versions functionality from the core to allow it's usage for managing files only. This could be easily accomplished by providing simpler FileObject and FileBrowserSite classes that are unaware of versions, and then providing a filebrowser.versions app that augments on that and provides the versioning methods, management commands and additional templates.

I made a fork without the versions features (since I didn't needed), and removing the unwanted code was very simple (the code is well decoupled already). If there's interest it can be used as a base for refactoring:

https://github.com/hcarvalhoalves/django-filebrowser

Sorry for opening a ticket without a patch, this is more of a suggestion. Since I won't use the versions functionality I don't have the time right now to make up a patch, but I wanted to move the idea forward.

Image resize validation

I want to suggest the option of validating the image to be sent from the size specified in the validation.

3.4.0 breaks TinyMCE integration

Browsing for an image in TinyMCE image plugin, django-filebrowser will not popup. Tested with 3.3.0 also, where it works as expected.

Directory does not exist

I'm running into an issue today getting Filebrowser running in my project.
I've got it configures in all locations according to the docs for settings and urls. The only thing different about my setup is that I'm using django-storages with s3boto for our media. I have sites.storage set accordingly.

This is the traceback I'm getting when trying to run the filebrowser tests:

$ ./manage.py test filebrowser
Traceback (most recent call last):
File "./manage.py", line 14, in
execute_manager(settings)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager
utility.execute()
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/core/management/init.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(_args, *_options.dict)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(_args, *_options)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/south/management/commands/test.py", line 8, in handle
super(Command, self).handle(_args, *_kwargs)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/core/management/commands/test.py", line 37, in handle
failures = test_runner.run_tests(test_labels)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/test/simple.py", line 358, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/test/simple.py", line 248, in build_suite
suite.addTest(build_suite(app))
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/test/simple.py", line 77, in build_suite
test_module = get_tests(app_module)
File "/Users/greg/.virtualenvs/newyork.com/lib/python2.6/site-packages/django/test/simple.py", line 35, in get_tests
test_module = import('.'.join(app_path + [TEST_MODULE]), {}, {}, TEST_MODULE)
File "/Users/greg/.virtualenvs/newyork.com/src/django-filebrowser/filebrowser/tests/init.py", line 2, in
from filebrowser.tests.base import FileObjectPathTests, FileObjectVersionTests, FileObjectUnicodeTests
File "/Users/greg/.virtualenvs/newyork.com/src/django-filebrowser/filebrowser/tests/base.py", line 17, in
from filebrowser.sites import site
File "/Users/greg/.virtualenvs/newyork.com/src/django-filebrowser/filebrowser/sites.py", line 524, in
site = FileBrowserSite(name='filebrowser')
File "/Users/greg/.virtualenvs/newyork.com/src/django-filebrowser/filebrowser/sites.py", line 109, in init
self.directory = DIRECTORY
File "/Users/greg/.virtualenvs/newyork.com/src/django-filebrowser/filebrowser/sites.py", line 118, in _directory_set
raise ImproperlyConfigured("Directory '%(dir)s' for the site %(app_name)s.%(name)s does not exist." % {'dir': val, 'app_name': self.app_name, 'name': self.name})
django.core.exceptions.ImproperlyConfigured: Directory '/Users/greg/dev/newyork.com/newyork/../static/filebrowser/' for the site filebrowser.filebrowser does not exist.

FileBrowseField does not include directory in fixture

When I try to serialize objects containing a FileBrowseField the resulting fixture does not include the directory path, only the filename. Here's an example:

[
{
"pk": 1,
"model": "calendar.image",
"fields": {
"title": "Test Image",
"image": "320x400_yellow.gif",
"created": "2011-09-22 14:27:33",
"modified": "2011-09-22 14:27:33",
"event": 1,
"alt": "Test Image",
"main": true,
"order": 0
}
}
]

Please note the original value for image is something like '/media/uploads/320x400_yellow.gif'.

The result is that any objects using FileBrowseField are not portable between servers using fixtures.

Allow FILEBROWSER_VERSIONS to specify filetype

probably the most important case is converting a .png original image to a .jpg version. .png thumbnails don't render as well at low resolution as .jpgs when dealing with things like line-art.

version alternative development image

when on a local machine or on a development-server, you might not have all the images available that are on your production instance (downloading these files on a regular basis is not an option).
therefore, it would be cool to have an additional option for every version ... something like "development" (think about the term) in order to show another image if the filebrowser-setting for this option as true.

french translation issue

The french translation makes upload window crash. Deleting the filebrowser/locale/fr/ directory "solve" the problem.

Proposal: Add option Disable removal of completed uploads in queue

Any thoughts on adding an option to disable the removal of completed uploads in queue for Ajax Upload. The uploadify equivalent would be 'removeCompleted' : false.

  • This would allows a user to keep track of recently uploaded files visually - eg. A user has 15 files located in different directories to upload and each will be uploaded to the same Filebrowser directory in one session.
  • Provides a better visual indication for upload completion of small files.

FILEBROWSER_VERSIONS_BASEDIR doesn't work...

I saw that this was apparently fixed in r683... but using:

FILEBROWSER_VERSIONS_BASEDIR = "versions/"
and or
FILEBROWSER_VERSIONS_BASEDIR = "versions"

has no effect... image versions are still just generated in FILEBROWSER_DIRECTORY

custom actions

with 3.3.x, we have some actions (e.g. rotate) on the detail-page: one should be able to write custom actions and easily implement these actions on the detail page.

Can't use spaces in name

With the default (undocumented?)

FOLDER_REGEX = getattr(settings, "FILEBROWSER_FOLDER_REGEX", r'^[\w._/-]+$')

I get a validation error when using a space character:
"Only letters, numbers, underscores, spaces and hyphens are allowed."

With

FILEBROWSER_FOLDER_REGEX = r'^[\w._\ /-]+$'

it works as expected.

remove TinyMCEAdmin.js

since grappelli is a requirement anyway, remove this file - tinymce_setup.js which comes with grappelli is a better example on how to configure tinymce.

Filebrowser uploads error constant

Hey there, I hate logging this as an issue as it may in fact be me, but having worked on this for a week now, installing/uninstalling everything to no avail ... Any help would be amazing. I'm receiving the below 6 FAILS using:

Python 2.6.5
Django 1.3.1
Grappelli 2.3.5
filebrowser 3.4.1

MEDIA_ROOT = "/srv/django/client_dir/assets/" - (Set to CHMOD 777 including all underneath)
MEDIA_URL = "/assets/"
STATIC_URL = "/static/"
STATIC_ROOT = "/srv/django/static/"

Thanks again,
Hope all is well ...

Errors:

Creating Test for the FileBrowser site: filebrowser
Creating test database for alias 'default'...
FFFFFF.........../usr/lib/python2.6/site-packages/django/core/context_processors.py:27: DeprecationWarning: The context processor at django.core.context_processors.auth is deprecated; use the path django.contrib.auth.context_processors.auth instead.
DeprecationWarning

.

FAIL: test_posix_paths (filebrowser.tests.base.FileObjectPathTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 58, in test_posix_paths
self.assertEqual(f.url, '/media/uploads/testdir/testfile.jpg')
AssertionError: '/assets/uploads/testdir/testfile.jpg' != '/media/uploads/testdir/testfile.jpg'

FAIL: test_windows_paths (filebrowser.tests.base.FileObjectPathTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 43, in test_windows_paths
self.assertEqual(f.url, '/media/uploads/testdir/testfile.jpg')
AssertionError: '/assets/uploads/testdir/testfile.jpg' != '/media/uploads/testdir/testfile.jpg'

FAIL: test_posix_paths (filebrowser.tests.base.FileObjectUnicodeTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 109, in test_posix_paths
self.assertEqual(f.url, filepath_to_uri('/media/uploads/$%^&/測試文件.jpg'))
AssertionError: '/assets/uploads/%24%25%5E%26
/%E6%B8%AC%E8%A9%A6%E6%96%87%E4%BB%B6.jpg' != '/media/uploads/%24%25%5E%26*/%E6%B8%AC%E8%A9%A6%E6%96%87%E4%BB%B6.jpg'

FAIL: test_windows_paths (filebrowser.tests.base.FileObjectUnicodeTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 93, in test_windows_paths
self.assertEqual(f.url, filepath_to_uri('/media/uploads/$%^&/測試文件.jpg'))
AssertionError: '/assets/uploads/%24%25%5E%26
/%E6%B8%AC%E8%A9%A6%E6%96%87%E4%BB%B6.jpg' != '/media/uploads/%24%25%5E%26*/%E6%B8%AC%E8%A9%A6%E6%96%87%E4%BB%B6.jpg'

FAIL: test_posix_paths (filebrowser.tests.base.FileObjectVersionTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 158, in test_posix_paths
self.assertEqual(f.url, '/media/uploads/testdir/testfile.jpg')
AssertionError: '/assets/uploads/testdir/testfile.jpg' != '/media/uploads/testdir/testfile.jpg'

FAIL: test_windows_paths (filebrowser.tests.base.FileObjectVersionTests)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/filebrowser/tests/base.py", line 143, in test_windows_paths
self.assertEqual(f.url, '/media/uploads/testdir/testfile.jpg')
AssertionError: '/assets/uploads/testdir/testfile.jpg' != '/media/uploads/testdir/testfile.jpg'


Ran 18 tests in 7.172s

FAILED (failures=6)
Destroying test database for alias 'default'...

Typo in filebrowser settings.py

There's a typo in filebrowser in settings.py on line 107. It should read:

FB_DEFAULT_PERMISSIONS = getattr(settings, "FB_DEFAULT_PERMISSIONS", 0664)

Instead it reads:

FB_DEFAULT_PERMISSIONS = getattr(settings, "FILEBROWSER_SEARCH_TRAVERSE", 0664)

AttributeError: 'NoneType' object has no attribute 'endswith'

Using filebrowser in your django project or running the test with python manage.py test filebrowser gives this error:

  ...
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

See also this stack overflow question: http://stackoverflow.com/questions/6780404/django-filebrowser-getting-an-attributeerror-nonetype-object-has-no-attribute

The fix is to prepend a \ before filebrowser\ in line 28 and line 29 in the django_filebrowser-3.n-pyN.egg/filebrowser/settings.py file.

Please include this (or another) fix for this problem in your main branch.

filebrowsefield with upload

currently, the filebrowsefield only allows for selecting files. direct upload would be a nice feature.

issues:

  1. djangos upload_to is very limited.
  2. once a file is selected (e.g. with djangos filefield) and there´s an error somewhere within the form, the file is lost. possible workaround: upload on select via ajax to a temp-directory. when the form is saved, move the file from the temp-directory to the upload-to-dir. of course, one should cleanup the temp-dir on a regular basis.

No thumbnails shown with filebrowser 3.3 on Windows Vista

What steps will reproduce the problem?

  1. Install filebrowser following v3.3 quick start guide, tests run ok.
  2. Upload some images
  3. Inspect results: no thumbnails

What is the expected output? What do you see instead?

  • Expect to see thumnails, see placeholder instead

What revision of the FileBrowser are you using?

  • Using filebrowser 3.3

What version/revision of Django are you using?

  • Using django 1.3

Please provide any additional information below.

Also when using FileBrowseField in Admin, I get following error:
TemplateSyntaxError at /admin/filebrowser/browse/
Caught KeyError while rendering: u'Image'
Request Method:
GET
Request URL:
http://localhost:8000/admin/filebrowser/browse/?pop=1&type=Image
Django Version:
1.3
Exception Type:
TemplateSyntaxError
Exception Value:
Caught KeyError while rendering: u'Image'
Exception Location:
C:\virtEnvBase\wentzel1\lib\site-packages\filebrowser\templatetags\fb_tags.py in render, line 121

That line 121 reads:
{% selectable fileobject.filetype query.type %}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.