google-code-export / django-filebrowser

Automatically exported from code.google.com/p/django-filebrowser
Other
0 stars 0 forks source link

3.3 has strict dependency on staticfiles #329

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
filebrowser.settings unconditionally refers to settings.STATIC_(ROOT|URL) vars. 
These are not mandatory if staticfiles app is not used.

Original issue reported on code.google.com by yuri.pim...@gmail.com on 23 Mar 2011 at 8:58

GoogleCodeExporter commented 9 years ago
the settings are there to be changed (it´s even mentioned in the docs that you 
need to change the settings if staticfiles isn´t being used).
what exactly is your proposal?

Original comment by sehmaschine on 23 Mar 2011 at 9:05

GoogleCodeExporter commented 9 years ago
Ok, i see. The problem is, it took me 30 minutes to figure out where is the 
problem from this error message:

Exception Type:     TemplateSyntaxError
Exception Value:    Caught ViewDoesNotExist while rendering: Tried browse in 
module filebrowser.views. Error was: 'NoneType' object has no attribute 
'endswith'

It is quite far from original error. Django has ImproperlyConfigured exception 
AFAIK. 

Original comment by yuri.pim...@gmail.com on 23 Mar 2011 at 9:24

GoogleCodeExporter commented 9 years ago
Anyway, even if i set these settings the exception won't go away. getattr still 
tries to evaluate settings.STATIC_URL.

It works if i rewrite filebrowser.settings this way:
URL_FILEBROWSER_MEDIA = getattr(settings, "FILEBROWSER_URL_FILEBROWSER_MEDIA") 
or os.path.join(settings.STATIC_URL, 'filebrowser/')
PATH_FILEBROWSER_MEDIA = getattr(settings, 
"FILEBROWSER_PATH_FILEBROWSER_MEDIA") or os.path.join(settings.STATIC_ROOT, 
'filebrowser/')

Original comment by yuri.pim...@gmail.com on 23 Mar 2011 at 11:12

GoogleCodeExporter commented 9 years ago
the exception is not nice. if we find a way to avoid that we´ll implement it.

sorry, but I can´t follow your last message. what is "these settings"?

it doesn´t work if you define FILEBROWSER_URL_FILEBROWSER_MEDIA (etc.) within 
your settings-file and change the path to your media-folder (instead of your 
static-folder)?

besides, you can still define STATIC_URL and STATIC_ROOT, even if you´re not 
using staticfiles. these settings just tell where to find your static media. 

Original comment by sehmaschine on 23 Mar 2011 at 11:57

GoogleCodeExporter commented 9 years ago
The exception pops up if no STATIC_(URL|ROOT) exist in settings.py. No matter 
defined FILEBROWSER_(URL|PATH)_FILEBROWSER_MEDIA or not.

Defining STATIC_(ROOT|URL) is not possible because django forbids having same 
value in STATIC_XXX and MEDIA_XXX vars.

Original comment by yuri.pim...@gmail.com on 23 Mar 2011 at 2:00