media upload in default project fails with undefined THUMBNAILS_DIR_NAME
niol opened this issue · comments
niol commented
Creating the default project with:
mezzanine-project project_name
cd project_name
python3 manage.py createdb --noinput
python3 manage.py changepassword admin
python3 manage.py runserver
and trying to upload a file in the gallery results in the following exception:
Internal Server Error: /admin/media-library/upload_file/
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line
34, in inner
response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 115,
in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 113,
in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/views/decorators/csrf.py", line 54
, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/contrib/auth/decorators.py", line
21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/filebrowser_safe/views.py", line 399, in
_upload_file
remove_thumbnails(file_path)
File "/usr/lib/python3/dist-packages/filebrowser_safe/views.py", line 79, in r
emove_thumbnails
path = os.path.join(dir_name, settings.THUMBNAILS_DIR_NAME, file_name)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 80, in __g
etattr__
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'THUMBNAILS_DIR_NAME'
Adding the following line to local_settings.py
works around the problem:
THUMBNAILS_DIR_NAME = ".thumbnails"
Ed Rivas commented
What version of mezzanine are you using?
Ed Rivas commented
Fixed in stephenmcd/filebrowser-safe@f9991d5. You can upgrade with pip install filebrowser-safe==1.0.0rc2
.