Commit graph

81 commits

Author SHA1 Message Date
René Leonhardt
75b51ce214 Avoid calling get_path() twice inside get_file
Overridden PathDownloadView.get_path() may contain database lookups and logging which should not be called twice if not necessary, as it was in my case.
Because the acquired filename does not change inside get_file(), I replaced the duplicate call.
2015-07-14 12:03:52 +02:00
Benoît Bryon
5fa0a6caea Psycho-rebased branch 87-double-quoted-filename on top of master 2015-06-13 00:57:44 +02:00
Benoît Bryon
2d04d30ba4 Refs #97 - Code style. 2015-06-12 20:51:51 +02:00
Benoît Bryon
d122c68455 Refs #97 - Splitted StringIteratorIO into TextIteratorIO and BytesIteratorIO. StringIteratorIO remains for backward compatibility. 2015-06-12 16:47:46 +02:00
Benoît Bryon
c54131db6e Refs #98 - Moved tests outside django-downloadview package, i.e. in tests/ folder at project root. 2015-06-12 15:42:50 +02:00
Benoît Bryon
047745f084 Refs #97 - HTTPFile proxies decoded file wrapper (was undecoded urllib3 file wrapper). 2015-06-11 17:02:18 +02:00
CJ
fbb0f30f2a refs #87 quotes for ascii filename to fix doctest 2014-06-06 12:07:12 -04:00
CJ
3b124f0cdb refs #87 quotes for ascii filename to fix doctest 2014-06-06 11:59:50 -04:00
CJ
d7073be658 refs #87 assert_basename test failing
Added quotes to assert_basename test.
2014-06-06 11:49:30 -04:00
CJ
616c822b6c refs #87 Quotes around ascii filename, not utf-8
Updated the test to go with my change.
2014-06-06 10:37:54 -04:00
CJ
77166d2969 refs #87 Quotes around ascii filename, not utf-8 2014-06-06 10:37:04 -04:00
CJ
1407c0cc4e Tests updated for double quotes around filename 2014-06-06 09:58:37 -04:00
CJ
7b2d8215e6 Filename surrounded by double quotes.
Chrome will give a Duplicate Header error if a file name has a comma in it, and the file name is not surrounded by  double quotes.
2014-06-06 09:55:20 -04:00
Benoît Bryon
5c262dfa52 Fixed compliance to latest flake8. 2014-03-31 16:53:17 +02:00
Benoît Bryon
eeaabd2a37 Refs #80 - Added a test around demo's 'object:inline_file' URL. 2014-03-03 08:15:46 +01:00
Benoît Bryon
7875999fe2 Refs #80 - Improved documentation about 'DownnloadMixin.attachment' attribute. 2014-03-03 07:49:30 +01:00
Benoît Bryon
70c6b00442 Refs #46 - Fixed Python 2 and Python 3 compatibility in doctests related to string/unicode. 2014-02-25 00:47:20 +01:00
Rémy HUBSCHER
1ea2790ba9 Refs #46 -- Add Py3 support. 2014-02-16 19:13:44 +01:00
Benoît Bryon
d587c515f0 Refs #74 - Switched to tox as test-environment manager. Added flake8 to the test suite. Dropped python 2.6 tests. Makefile no longer creates a virtualenv. 2014-02-10 01:27:14 +01:00
Benoît Bryon
6dd090757a Refs #41 - Added 'mimetype' and 'encoding' arguments to 'DownloadMixin' => supported all arguments of original sendfile() function. Added documentation about migrating from django-sendfile to django-downloadview. 2013-11-29 00:55:46 +01:00
Benoît Bryon
59d9b4966e Refs #41 - django_downloadview.sendfile is a PathDownloadView (was StorageDownloadView). PathDownloadView.get_file() raises FileNotFound if file does not exists. 2013-11-28 23:29:50 +01:00
Benoît Bryon
e33a8165ef Refs #2 - Introduced support of Lighttpd's X-Sendfile (mostly copied from django_downloadview.apache). 2013-11-28 23:02:40 +01:00
Benoît Bryon
8b44724c90 Refs #36 - Introduced support of Apache X-Sendfile. 2013-11-26 09:30:19 +01:00
Benoît Bryon
567cf591b9 Refs #43 - ObjectDownloadView.get_file() raises FileNotFound if field is empty. Raises AttributeError if field does not exist (view or model is misconfigured). 2013-11-24 10:09:46 +01:00
Benoît Bryon
0b2a26e180 Refs #43 - ObjectDownloadView.get_file() raises FileNotFound if file field does not exists or is empty. Introduced DownloadMixin.file_not_found_response(). 2013-11-24 10:03:11 +01:00
Benoît Bryon
f2d5a92b99 Refs #7 - Urlencoded non US-ASCII characters in Content-Disposition header (file name). 2013-11-18 12:12:02 +01:00
Benoît Bryon
f170c8904b Psycho-rebased branch 60-virtualfile-force-bytes on top of master 2013-11-08 09:59:51 +01:00
Benoît Bryon
c141f027de Refs #60 - VirtualFile uses force_bytes(). Removed (wrong) patch of File.__iter__(). 2013-11-08 09:56:26 +01:00
Benoît Bryon
c372cac003 Refs #57 - PathDownloadView opens files in binary mode by default. 2013-11-08 09:38:57 +01:00
Benoît Bryon
e9d9b3dfaa Refs #25 - Introduced SmartDownloadMiddleware: makes it possible to setup several rules given a single optimization backend. 2013-11-07 00:09:30 +01:00
Benoît Bryon
2c1ad3c730 ObjectDownloadView now inherits from SingleObjectMixin and BaseDownloadView. Added example for setup_view() in documentation. 2013-11-05 11:44:48 +01:00
Benoît Bryon
0371f84f26 Added unit tests around BaseDownloadView. Introduced setup_view() test utility. 2013-11-05 07:29:58 +01:00
Benoît Bryon
def3e97a39 Added unit tests for DownloadMixin. 2013-11-04 23:20:13 +01:00
Benoît Bryon
4c3787b2a0 Refs #25 - Added unit tests about API and deprecated settings. 2013-10-29 09:25:48 +01:00
Benoît Bryon
874f3b9b54 Refs #25, refs #39, refs #40, refs #42 - Big refactoring in documentation and demo: narrative documentation uses examples from demo project. 2013-10-28 16:58:18 +01:00
Benoît Bryon
47cc4ce04d Refs #41 - Introduced experimental port of django-sendfile's sendfile() function. 2013-10-21 15:04:30 +02:00
Benoît Bryon
4547cc2f90 Refs #42 - Ignored Content-Length header for generated files. 2013-10-21 15:02:37 +02:00
Benoît Bryon
a38876d15c Refs #42 - Introduced StringIteratorIO, for use in VirtualDownloadView when you need to stream generated content (yield). 2013-10-21 14:59:25 +02:00
Benoît Bryon
7c3b3a8de2 Splitted django_downloadview.views in several smaller modules. 2013-10-21 14:57:54 +02:00
Benoît Bryon
f34deba503 Moved API imports from django_downloadview's __init__.py to api.py. 2013-10-21 14:54:57 +02:00
Benoît Bryon
588b1b0a6e Introduced DownloadDispatcherMiddleware and settings.DOWNLOADVIEW_MIDDLEWARES. Deprecated most options for former global XAccelRedirectMiddleware. Splitted nginx module into a package. Introduced BaseDownloadMiddleware. 2013-10-04 18:11:16 +02:00
Benoît Bryon
121fb4d391 Refs #26 - Do not compute size of virtual files, unless file wrapper implements was_modified_since(). 2013-05-28 15:17:01 +02:00
Benoît Bryon
6c40354f4a Refs #34, refs #35 - Added documentation about DownloadMixin and BaseDownloadView. 2013-05-28 08:34:33 +02:00
Benoît Bryon
31c0a0f4b9 Refs #34 - Introduced unit tests for DownloadMixin.was_modified_since(). Refactored DownloadMixin: easier to test, better docstrings. 2013-05-14 00:25:30 +02:00
Rémy HUBSCHER
af2133909e Fix AttributeError: 'File' object has no attribute 'modified_time' 2013-05-07 18:50:51 +02:00
Benoît Bryon
e8266615ed Refs #32 - Respect 'attachment' argument in X-Accel optimization. 2013-05-06 16:50:47 +02:00
Benoît Bryon
58a5131a39 Refs #29 - Improved HTTPDownloadView. 2013-04-09 16:50:24 +02:00
Benoît Bryon
a770727b5e Encoded data written to StringIO. 2013-04-08 16:36:53 +02:00
Benoît Bryon
3b65324a06 Refs #29 - Introduced HTTPFile and HTTPDownloadView to create proxy to arbitrary HTTP URL. 2013-04-08 15:39:06 +02:00
Benoît Bryon
5a3ff57e23 Refs #13 - Using Django's StreamingHttpResponse. Requires Django>=1.5. Introduced django_downloadview.test.assert_download_response(). 2013-03-20 16:00:20 +01:00