summaryrefslogtreecommitdiff
path: root/django/views/static.py
AgeCommit message (Collapse)Author
2020-09-14Fixed #31789 -- Added a new headers interface to HttpResponse.Tom Carrick
2020-05-11Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
2019-12-18Refs #30585 -- Updated project templates and tests to use (block)translate tags.Mike Hansen
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2019-05-13Refs #28593 -- Changed url() to path() in comments following URL routing ↵Tobias Bengfort
changes.
2018-05-15Fixed #16470 -- Allowed FileResponse to auto-set some Content headers.Claude Paroz
Thanks Simon Charette, Jon Dufresne, and Tim Graham for the reviews.
2018-04-19Ref #23919 -- Replaced some os.path usage with pathlib.Path.Tom
2018-01-21Fixed #29038 -- Removed closing slash from HTML void tags.Jon Dufresne
2017-04-25Fixed #28122 -- Fixed crash when overriding views.static.directory_index()'s ↵Tim Graham
template.
2017-04-04Fixed CVE-2017-7234 -- Fixed open redirect vulnerability in ↵Tim Graham
views.static.serve(). This is a security fix.
2017-03-17Fixed #27948 -- Removed incorrect unquote() in static serving views.Tim Graham
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-08-10Fixed #26973 -- Fixed views.static.serve() crash with show_indexes enabled.Tim Graham
2015-08-08Refs #25236 -- Removed ifequal/ifnotequal usage.Tim Graham
2015-02-22Fixed a few uses of Template that relied on a default engine.Aymeric Augustin
Refs #24389.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-05Fixed #24072 -- Added FileResponse for streaming binary files.Collin Anderson
2014-08-12Fixed #23276 -- Deprecated passing views as strings to url().Tim Graham
2013-11-04Merge pull request #1821 from Bouke/tickets/14170Aymeric Augustin
#14170 -- Reset i18n cache when settings changed
2013-11-03Fixed #14170 -- Reset i18n cache when settings changeBouke Haarsma
2013-11-02Correct flake8 E302 violationsRay Ashman Jr
2013-10-26Fixed all the E203 violationsAlex Gaynor
2013-09-05Took advantage of django.utils.six.moves.urllib.*.Aymeric Augustin
2013-06-29Removed compatibility code for streaming responses.Aymeric Augustin
This code provided a deprecation path for old-style streaming responses. Refs #6527, #7581.
2013-01-24Minor optimization in the static serve view.Aymeric Augustin
2012-10-20Fixed #7581 -- Added streaming responses.Aymeric Augustin
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-09-26Fixed #18675 -- Fixed was_modified_since with floating-point mtimeClaude Paroz
Thanks Simon Charette for the patch.
2012-08-22Fixed #11340 -- Prevented HttpResponseNotModified to have content/content-typeClaude Paroz
The HTTP 1.1 spec tells that the 304 response MUST NOT contain a message body. Thanks aparajita for the report.
2012-07-22[py3] Updated urllib/urllib2/urlparse imports.Aymeric Augustin
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
2012-06-30Removed usage of mimetype kwarg of HttpResponseClaude Paroz
Refs #16519.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-03-30Removed with_statement imports, useless in Python >= 2.6. Refs #17965. ↵Claude Paroz
Thanks jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-05Updated core base translation files with new strings. Refs #17822.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17655 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04Fixed #17458 -- Marked Http404 error messages for translation. Thanks, ↵Jannis Leidel
Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-27Explicitly close a file in the static serve view. Thanks to Benjamin ↵Alex Gaynor
Peterson for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20Switched to HTML5 doctype in all Django supplied templates.Luke Plant
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-04Fixed #15613: Don't send content-length headers for non-regular files. ↵Andrew Godwin
Thanks to jaylett. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-02Fixed #15531 -- Partially reverted [15701] due to compatibility issues with ↵Jannis Leidel
middlewares that modify content of responses. Thanks for the report, schinckel. Refs #15281. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01Fixed #15281 -- Made the static view use an iterator when serving a file, ↵Jannis Leidel
effectively making this less of a memory hog. Also use the appropriate attributes of the stat object instead of indexes. Thanks for the initial patch, FunkyBob and aaugustin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01Fixed #717 - If-Modified-Since handling should compare dates according to ↵Luke Plant
RFC 2616 Thanks to Maniac for the report, julienb for the initial patch, and especially to aaugustin for the final patch and tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14Fixes #15270 -- Moved back the serve view to django.views.static due to ↵Jannis Leidel
dependency conflicts with the contrib app staticfiles (reverts parts of r14293). Added a helper function that generates URL patterns for serving static and media files during development. Thanks to Carl for reviewing the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-17Fixed #14693, #14709 -- Backwards incompatible change to rectify the ↵Jannis Leidel
confusion around the STATICFILES_URL and STATICFILES_ROOT settings. * Two new global settings that will be used by -- **but are not limited to** -- the staticfiles app: STATIC_ROOT and STATIC_URL. * Moving the 'django.contrib.staticfiles.templatetags.staticfiles' template tag to the core ('django.templatetags.static') and renaming it to 'get_static_prefix'. * Moving the context processor 'django.contrib.staticfiles.context_processors.staticfiles' to the core ('django.core.context_processors.static') and renaming it to 'static'. * Paths in media definitions will use STATIC_URL as the prefix if the value is not None, and falls back to the previously used MEDIA_URL. Thanks again to the community for constructive criticism and Carl and Russ for sanity-inducing discussions on IRC. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11Fixed #14524, #14582, #14617, #14665 and #14667 -- Tweaked staticfiles app.Jannis Leidel
* Updated StaticFilesHandler and AdminMediaHandler to make use of the 404 handler if needed. * Updated runserver management command to serve static files only in DEBUG mode (or if specified the --insecure option) and if the staticfiles app is in INSTALLED_APPS. Also added an option to disable serving completely (--nostatic). * Added check in debug mode if STATICFILES_* settings are different to MEDIA_* settings. * Removed a faulty PendingDeprecationWarning in AdminMediaHandler that is triggered every time runserver is used. * Fixed an issue with the modification time checks when running collectstatic. * Extended and refined documentation. Thanks to everyone for input, especially to Carl Meyer, Ted Kaemming and Adam Vandenberg for patches. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-20Fixed #12323 and #11582 -- Extended the ability to handle static files. ↵Jannis Leidel
Thanks to all for helping with the original app, the patch, documentation and general support. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26Fixed #12544 and #13600 -- Fixed static files serving view to catch invalid ↵Jannis Leidel
date from If-Modified-Since header. Thanks akaihola and SmileyChris for patches. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26Fixed #7535 -- Correctly set Content-Encoding header in static files serving ↵Jannis Leidel
view. Thanks for the report and patch, Kevin Hunter. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10Changed a whole bunch of places to raise exception instances instead of ↵Adrian Holovaty
old-style raising exception classes plus a comma. Good for the future Python 3 conversion git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09Fixed #11757 - Set mimetype when responding with HttpResponseNotModified in ↵Jannis Leidel
django.server.static. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12141 bcc190cf-cafb-0310-a4f2-bffc1f526a37