Ticket #5727: views_static__serve_file.diff
File views_static__serve_file.diff, 816 bytes (added by , 17 years ago) |
---|
-
django/views/static.py
46 46 raise Http404, "Directory indexes are not allowed here." 47 47 if not os.path.exists(fullpath): 48 48 raise Http404, '"%s" does not exist' % fullpath 49 return serve_file(request, fullpath) 50 51 def serve_file(request, fullpath): 52 """ 53 If you don't want to server static files with apache/lighttpd, 54 you can use this method. 55 One reason might be, that you need to check permissions before you allow 56 access to this file. 57 """ 49 58 # Respect the If-Modified-Since header. 50 59 statobj = os.stat(fullpath) 51 60 if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'),