'django media_root not working
I'm using django 1.6
in my settings I have this, which works fine,
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static/'),
)
but the moment I add: `MEDIA_ROOT = os.path.join(BASE_DIR, 'media/'),
I get a error while rendering a template:
'tuple' does not support the buffer interface
problem code: <link href=" {% static 'bootstrap/css/bootstrap.min.css' %} " rel="stylesheet">
Is there some kind of conflict between these 2 settings? all I'm trying to do is serve user uploaded files, should I just change the upload_to setting to the static directory?
has anyone experienced this before or know what might be the problem
any help is appreciated, thanks
Solution 1:[1]
Instead of importing the os library, you should import os.path, as done followingly:
import os.path
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lemon |
