2

I have installed Django file browser and added grappelli and filebrowser to my installed apps. And did every thing said in documention but when I browse http://127.0.0.1:8000/admin/filebrowser/ I got 404 page not found error. What's the problem? I configured my media settings like this:

# Media files
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/media/admin/'
FILEBROWSER_DIRECTORY = '/media/'
hamidfzm
  • 4,595
  • 8
  • 48
  • 80
  • What versions did you install? – Simeon Visser Feb 11 '14 at 18:03
  • @SimeonVisser FileBrowser 3.5 and Grappelli 2.5.1 from GitHub. Actually I cloned them and use their source folders. – hamidfzm Feb 11 '14 at 18:07
  • 1
    Do you see anything at `http://127.0.0.1:8000/admin/filebrowser/browse/`? According to the source code there's no base URL for filebrowser, only specific URLs. – Simeon Visser Feb 11 '14 at 18:08
  • @SimeonVisser I see `Bad Request (400)` page at `http://127.0.0.1:8000/admin/filebrowser/browse/` – hamidfzm Feb 11 '14 at 18:09
  • Could you try `http://127.0.0.1:8000/admin/filebrowser/upload/`? Perhaps you need some additional parameters for `/browse/`. – Simeon Visser Feb 11 '14 at 18:11
  • @SimeonVisser No, Again I see same error page but it's not django error page and I think it's for file browser. And what do you mean by additional parameters for `/browse/` ? – hamidfzm Feb 11 '14 at 18:13
  • Parameters in the URL. But this shows that filebrowser works, it's just that something isn't configured properly yet. Does `DEBUG = True` tell you anything? – Simeon Visser Feb 11 '14 at 18:17
  • @SimeonVisser In my uls.py I've added these two lines: `(r'^grappelli/', include('grappelli.urls')),(r'^admin/filebrowser/', include(site.urls)),` – hamidfzm Feb 11 '14 at 18:22

2 Answers2

0

Just solved the exact same problem, and it's the oldest one in the book: permissions
(facepalm)

  • make sure your media dir is chmod-ed to 755
  • create media/uploads dir and also chmod it to 755

In settings.py, I don't use the FILEBROWSER_DIRECTORY (I guess that uploads is the default)

I really think that throwing 400 Bad Request is utterly useless and anoying, but oh well...


Just a related note: I don't think there is anything at /admin/filebrowser/, it just gives me a 404. Please correct me it I'm missing something here :)

frnhr
  • 12,354
  • 9
  • 63
  • 90
0

The problem is your FILEBROWSER_DIRECTORY setting. It should have absolute path.

Unfortunately, the error is hidden by the nasty 400 Bad Request, as explained in this ticket.

pryma
  • 698
  • 8
  • 12