Hopefully this will be an easy one for anyone with any Django experience.
I’m trying to get to grips with this framework and Python in general and have downloaded the filebrowser app.
It allows me to create folders OK, however it is unable to locate its css.
While looking at a page, I get the following in the console:
[20/Apr/2011 14:05:10] "GET /admin/ HTTP/1.1" 200 11282
[20/Apr/2011 14:05:12] "GET /admin/filebrowser/browse/ HTTP/1.1" 200 14747
[20/Apr/2011 14:05:12] "GET /media/filebrowser/css/filebrowser.css HTTP/1.1" 404 2324
The third line appears in yellow as Django is unable to locate the css file.
Presumably I’m just missing / have an incorrect line in my settings.py file, but I’m not sure what I need to change.
Can anyone help?
These are the relavant (I think) lines from my settings:
import os
SITE_ROOT = os.path.realpath(os.path.dirname(__file__)`)
MEDIA_ROOT = os.path.join(SITE_ROOT, 'media/uploads/')
MEDIA_URL = '/media/'
FILEBROWSER_DIRECTORY = ''
STATIC_ROOT = os.path.join(SITE_ROOT, 'media/')
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/"
Any advice appreciated and apologies if this seems a little basic, I’m only just getting to grips with this really.
Thanks.
I hope I can answer your question correctly.
If you are using the latest version of Django 1.3 and Django-Grapelli 2.3 then you need the latest version of Django-Filebrowser 3.3. This is becuse the old version of Filebrowser 3.2 and below, does not support static file, which is included by default in Django 1.3.
What you need to do is to svn the Filebrowser 3.3 from the branches to your python site-packages:
Now you can run to get the filebrowser into your static folder: