Skip to content

I have to append media/ to the path to not get a 404 #69

@surfer190

Description

@surfer190

I might be conflicting with django media settings but I have to append media to the path.

I added the following url:

    # protected media
    url(r'^media/(?P<path>.*)$', get_media, name='get_media')

Then the get_media function based view:

def get_media(request, path):
    # append media to path
    return sendfile(request, 'media/' + path)

If I don't append media. then it fails here:

if not os.path.exists(filename):
        from django.http import Http404
        raise Http404('"%s" does not exist' % filename)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions