Don't you have MEDIA_ROOT and STATIC_ROOT in templates?