Django FileBrowser 400 Error

安稳与你 提交于 2019-12-13 00:15:54

问题


I'm getting a 400 error when trying to access the /admin/filebrowser/browse/ page. I followed the instructions as per https://django-filebrowser.readthedocs.org/en/3.5.2/quickstart.html and have my URLs and installed apps configured correctly.

What I'm not too sure about are the media paths in settings.py;

FILEBROWSER_DIRECTORY = os.path.join(BASE_DIR, '/ogencat/MEDIA/uploads')

FILEBROWSER_MEDIA_ROOT = os.path.join(BASE_DIR, '/ogencat/MEDIA')

FILEBROWSER_MEDIA_URL = '/MEDIA/'

I have folder in my workspace called MEDIA and a folder within called uploads.

I wasn't too sure about what the docs wanted me to do in terms of setting these paths - I hadn't seen the getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT) syntax before so I just added the paths as I have done for the rest of settings.py

Thanks!


回答1:


  1. You need to add trailing slashes
  2. Directories must exist prior accessing them


来源:https://stackoverflow.com/questions/25380662/django-filebrowser-400-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!