Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django-tinymce and django-filebrowser, image upload Error finding Upload-Folder (MEDIA_ROOT + DIRECTORY)

So I'm trying to get filebrowser working with tinymce in django. Evrything goes fine with tinymce, nice fancy text editor. When I try to open the file browser i get ImproperlyConfigured at /admin/filebrowser/browse/ Error finding Upload-Folder (MEDIA_ROOT + DIRECTORY). Maybe it does not exist?I don't get any errors in the console from that and so far as i can tell it should be looking for /media/filebrowser/ which definitely exist

python manage.py test filebrowser give me this:

FAIL: test_directory (filebrowser.tests.settings.SettingsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nada/costumeshoppe/filebrowser/tests/settings.py", line 29, in test_directory
    self.assertEqual(os.path.exists(os.path.join(MEDIA_ROOT,DIRECTORY)), 1)

AssertionError: False != 1

my settings:

STATIC_ROOT = ROOT_PATH +'/public/static/'
STATIC_URL = '/static/'
MEDIA_ROOT = ROOT_PATH + '/public/media/'
MEDIA_URL = '/media/'
TINYMCE_JS_ROOT = '/static/tiny_mce/'
TINYMCE_JS_URL = os.path.join(STATIC_URL, "tiny_mce/tiny_mce_src.js")
TINYMCE_DEFAULT_CONFIG = {
    'plugins': "table,spellchecker,paste,searchreplace,styles",
    'theme': "advanced",
}

my urls:

if settings.DEBUG:
        urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.MEDIA_ROOT,})
   )

urlpatterns += staticfiles_urlpatterns()

I'm running in debug mode, don't know if that's the problem, do have a weird issue where i can use the static url to load static files but they have to be in the media directory, though the filebrowser static files are in my static file location which fixed some installation problems, but putting those files in media location as well didn't change anything. Any ideas what is needed to do to get this to work?

like image 962
Christopher Avatar asked Sep 08 '11 05:09

Christopher


2 Answers

The Default FILEBROWSER_DIRECTORY is "uploads" so you should check if '/media/uploads' exists

like image 130
Rakesh Avatar answered Sep 28 '22 00:09

Rakesh


DIRECTORY is set in filebrowser.settings by default to uploads/ does this folder exist inside your media root?

This default can be changed in your settings.py with FILEBROWSER_DIRECTORY

like image 36
JamesO Avatar answered Sep 28 '22 01:09

JamesO