Commit Graph

682 Commits

Author SHA1 Message Date
Claude Paroz 7c5b244826 Fixed #17061 -- Factored out importing object from a dotted path
Thanks Carl Meyer for the report.
2013-02-04 16:38:25 +01:00
Aymeric Augustin 3f1c7b7053 Simplified default project template.
Squashed commit of:

commit 508ec9144b35c50794708225b496bde1eb5e60aa
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 22:50:55 2013 +0100

    Tweaked default settings file.

    * Explained why BASE_DIR exists.
    * Added a link to the database configuration options, and put it in its
      own section.
    * Moved sensitive settings that must be changed for production at the
      top.

commit 6515fd2f1aa73a86dc8dbd2ccf512ddb6b140d57
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 14:35:21 2013 +0100

    Documented the simplified app & project templates in the changelog.

commit 2c5b576c2ea91d84273a019b3d0b3b8b4da72f23
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:59:27 2013 +0100

    Minor fixes in tutorials 5 and 6.

commit 55a51531be8104f21b3cca3f6bf70b0a7139a041
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:51:11 2013 +0100

    Updated tutorial 2 for the new project template.

commit 29ddae87bdaecff12dd31b16b000c01efbde9e20
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:58:54 2013 +0100

    Updated tutorial 1 for the new project template.

commit 0ecb9f6e2514cfd26a678a280d471433375101a3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:29:13 2013 +0100

    Adjusted the default URLconf detection to account for the admin.

    It's now enabled by default.

commit 5fb4da0d3d09dac28dd94e3fde92b9d4335c0565
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 10:36:55 2013 +0100

    Added security warnings for the most sensitive settings.

commit 718d84bd8ac4a42fb4b28ec93965de32680f091e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:24:06 2013 +0100

    Used an absolute path for the SQLite database.

    This ensures the settings file works regardless of which directory
    django-admin.py / manage.py is invoked from.

    BASE_DIR got a +1 from a BDFL and another core dev. It doesn't involve
    the concept of a "Django project"; it's just a convenient way to express
    relative paths within the source code repository for non-Python files.

    Thanks Jacob Kaplan-Moss for the suggestion.

commit 1b559b4bcda622e10909b68fe5cab90db6727dd9
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:22:40 2013 +0100

    Removed STATIC_ROOT from the default settings template.

    It isn't necessary in development, and it confuses beginners to no end.

    Thanks Carl Meyer for the suggestion.

commit a55f141a500bb7c9a1bc259bbe1954c13b199671
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:21:43 2013 +0100

    Removed MEDIA_ROOT/URL from default settings template.

    Many sites will never deal with user-uploaded files, and MEDIA_ROOT is
    complicated to explain.

    Thanks Carl Meyer for the suggestion.

commit 44bf2f2441420fd9429ee9fe1f7207f92dd87e70
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:22:09 2013 +0100

    Removed logging config.

    This configuration is applied regardless of the value of LOGGING;
    duplicating it in LOGGING is confusing.

commit eac747e848eaed65fd5f6f254f0a7559d856f88f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:05:31 2013 +0100

    Enabled the locale middleware by default.

    USE_I18N is True by default, and doesn't work well without
    LocaleMiddleware.

commit d806c62b2d00826dc2688c84b092627b8d571cab
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:03:16 2013 +0100

    Enabled clickjacking protection by default.

commit 99152c30e6a15003f0b6737dc78e87adf462aacb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:01:48 2013 +0100

    Reorganized settings in logical sections, and trimmed comments.

commit d37ffdfcb24b7e0ec7cc113d07190f65fb12fb8a
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:54:11 2013 +0100

    Avoided misleading TEMPLATE_DEBUG = DEBUG.

    According to the docs TEMPLATE_DEBUG works only when DEBUG = True.

commit 15d9478d3a9850e85841e7cf09cf83050371c6bf
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:46:25 2013 +0100

    Removed STATICFILES_FINDERS/TEMPLATE_LOADERS from default settings file.

    Only developers with special needs ever need to change these settings.

commit 574da0eb5bfb4570883756914b4dbd7e20e1f61e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:45:01 2013 +0100

    Removed STATICFILES/TEMPLATES_DIRS from default settings file.

    The current best practice is to put static files and templates in
    applications, for easier testing and deployment.

commit 8cb18dbe56629aa1be74718a07e7cc66b4f9c9f0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:24:16 2013 +0100

    Removed settings related to email reporting from default settings file.

    While handy for small scale projects, it isn't exactly a best practice.

commit 8ecbfcb3638058f0c49922540f874a7d802d864f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 18:54:43 2013 +0100

    Documented how to enable the sites framework.

commit 23fc91a6fa67d91ddd9d71b1c3e0dc26bdad9841
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:28:59 2013 +0100

    Disabled the sites framework by default.

    RequestSite does the job for single-domain websites.

commit c4d82eb8afc0eb8568bf9c4d12644272415e3960
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 00:08:33 2013 +0100

    Added a default admin.py to the application template.

    Thanks Ryan D Hiebert for the suggestion.

commit 4071dc771e5c44b1c5ebb9beecefb164ae465e22
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:59:49 2013 +0100

    Enabled the admin by default.

    Everyone uses the admin.

commit c807a31f8d89e7e7fd97380e3023f7983a8b6fcb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:57:05 2013 +0100

    Removed admindocs from default project template.

commit 09e4ce0e652a97da1a9e285046a91c8ad7a9189c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:32:52 2013 +0100

    Added links to the settings documentation.

commit 5b8f5eaef364eb790fcde6f9e86f7d266074cca8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 11:06:54 2013 +0100

    Used a significant example for URLconf includes.

commit 908e91d6fcee2a3cb51ca26ecdf12a6a24e69ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:22:31 2013 +0100

    Moved code comments about WSGI to docs, and rewrote said docs.

commit 50417e51996146f891d08ca8b74dcc736a581932
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 15:51:50 2013 +0100

    Normalized the default application template.

    Removed the default test that 1 + 1 = 2, because it's been committed
    way too many times, in too many projects.

    Added an import of `render` for views, because the first view will
    often be:

    def home(request):
        return render(request, "mysite/home.html")
2013-02-04 13:21:36 +01:00
Aymeric Augustin 23e319d729 Fixed #19076 -- Added content_type attribute to TemplateView.
Thanks Gavin Wahl.
2013-01-30 21:26:17 +01:00
Claude Paroz 4b3f7110ae Fixed #16123 -- Ensured strptime receive proper string type
strptime generates an UnicodeEncodeError when using a non-ascii
unicode string on Python 2.
2013-01-26 20:53:09 +01:00
Aymeric Augustin 57c6617c92 Minor optimization in the static serve view. 2013-01-24 11:01:32 +01:00
Julien Phalip 9180146d21 Fixed #19453 -- Ensured that the decorated function's arguments are obfuscated in the @sensitive_variables decorator's frame, in case the variables associated with those arguments were meant to be obfuscated from the decorated function's frame.
Thanks to vzima for the report.
2012-12-31 09:34:08 -08:00
Aymeric Augustin 130829334c Removed csrf_response_exempt and csrf_view_exempt. 2012-12-29 21:59:07 +01:00
Aymeric Augustin 2ecf56ea3f Removed legacy ways of calling cache_page. 2012-12-29 21:59:07 +01:00
Florian Apolloner a2f2a39956 Fixed #18856 -- Ensured that redirects can't be poisoned by malicious users. 2012-12-10 22:11:39 +01:00
Claude Paroz c91667338a Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-12-08 11:13:52 +01:00
Claude Paroz 795ac7deda Fixed #19378 -- Ensured get_success_url returns a non-lazy URL 2012-12-04 13:22:42 +01:00
George Hickman ea6b95dbec Fixed #19316 -- Set View args/kwargs/request before dispatch 2012-11-22 20:13:01 +01:00
Tim Graham 7b2d95eb30 Clarified usage of as_view kwargs for setting arguments on class based views
Thanks Dave McLain for the patch.
2012-11-22 09:07:21 -05:00
Chris Beaven 48e8b5e944 Add orphans support to MultipleObjectMixin
Fixes #7005
2012-11-21 16:50:23 +13:00
Jannis Leidel 778b8bdcf4 Merge pull request #467 from tomchristie/page-kwarg
Add 'page_kwarg' attribute to `MultipleObjectMixin`, removing hardcoded "page".
2012-11-17 12:27:01 -08:00
Jannis Leidel 4a5e8087ac Fixed #19136 -- Properly escape gettext context prefixes in the i18n JavaScript view template. 2012-11-17 15:37:30 +01:00
Preston Holmes 6bd61194d4 Fixed py3 compatibility for 5a00a57aa5 2012-11-04 23:38:41 -08:00
Preston Holmes 5a00a57aa5 Fixed #19240 -- include pagination error details in ListView 404
Thanks to seawolf for the patch
2012-11-04 15:52:00 -08:00
Ian Clelland 3629a159f9 PEP 302 source loaders already decode appropriately 2012-10-26 01:40:32 +01:00
Tom Christie 502be865c6 Add 'page_kwarg' attribute to `MultipleObjectMixin`, removing hardcoded 'page'. 2012-10-25 10:31:14 +01:00
Aymeric Augustin 4b27813198 Fixed #7581 -- Added streaming responses.
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-10-20 20:05:11 +02:00
Claude Paroz 4797ad80da [py3] Decoded the parsed source file encoding in debug view 2012-10-08 10:06:56 +02:00
Claude Paroz 8bd7b598b6 Fixed #18807 -- Made 404.html and 500.html optional
Thanks Aymeric Augustin for the report and Jannis Leidel for the
review.
2012-09-30 23:16:19 +02:00
Claude Paroz 6c2faaceb0 Made more extensive use of get_current_site
Refs #15089
2012-09-28 20:33:05 +02:00
Claude Paroz 3cbe686af6 Fixed #18675 -- Fixed was_modified_since with floating-point mtime
Thanks Simon Charette for the patch.
2012-09-26 21:12:56 +02:00
Aymeric Augustin baa33cd8fa Fixed #16218 -- date_list order in generic CBVs.
Thanks nnrcschmdt for the report and bpeschier for the initial
version of the patch.
2012-09-22 11:47:34 +02:00
Claude Paroz 26ff2be787 Imported getLogger directly from logging module
This was a remainder of some 2.4 compatibility code.
2012-09-20 21:03:24 +02:00
Aymeric Augustin 7207327dd3 Updated docs for dates generic views.
Fixes #18245. Refs #3542.
2012-09-08 12:22:39 -04:00
Claude Paroz ebc773ada3 Replaced many smart_bytes by force_bytes
In all those occurrences, we didn't care about preserving the
lazy status of the strings, but we really wanted to obtain a
real bytestring.
2012-08-29 11:20:32 +02:00
Claude Paroz 7cfe8e8fce Fixed #11340 -- Prevented HttpResponseNotModified to have content/content-type
The HTTP 1.1 spec tells that the 304 response MUST NOT contain a
message body.
Thanks aparajita for the report.
2012-08-22 20:55:24 +02:00
Marc Tamlyn 8d5c11caad Fixed #3542 -- Add support for changing granularity on ArchiveView.
Resolving the concept from a very old ticket in a more class-based-view
manner.
2012-08-18 17:03:57 +01:00
Marc Tamlyn f04bb6d798 Fixed #17228 -- params context variable is inconsistent
Remove the params variable from the context and just put the variables
in directly.

This had not been committed previously as the original pattern was used
in the functional generic views and we wanted consistency between them,
but django.views.generic.simple.direct_to_template is now gone so we can
do it 'right'.
2012-08-18 15:07:21 +01:00
Marc Tamlyn 58683e9c82 Fixed #16744 -- Class based view should have the view object in the context
Updated the most recent patch from @claudep to apply again and updated
the documentation location.
2012-08-18 15:07:21 +01:00
Aymeric Augustin c5ef65bcf3 [py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
2012-08-07 12:00:22 +02:00
Aymeric Augustin ee191715ea [py3] Fixed access to dict keys/values/items. 2012-08-07 12:00:22 +02:00
Florian Apolloner 4b5cb116e3 Fixed error message in detail generic view.
Thanks go to mitar for the report and the patch.
2012-07-25 22:46:57 +02:00
Aymeric Augustin 0d914d08a0 [py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
2012-07-22 09:29:55 +02:00
Aymeric Augustin bdca5ea345 [py3] Replaced unicode/str by six.text_type/bytes. 2012-07-22 09:29:54 +02:00
Aymeric Augustin 3cb2457f46 [py3] Replaced basestring by six.string_types. 2012-07-22 09:29:54 +02:00
Adrian Holovaty 8855f9380e Merge pull request #176 from benspaulding/ticket_18521
Add reST role to templates named in some view docs.
2012-07-06 12:46:26 -07:00
Claude Paroz deed192dda Removed usage of mimetype kwarg of HttpResponse
Refs #16519.
2012-06-30 21:19:07 +02:00
Ben Spaulding 24dec9edaa Add reST role to templates named in some view docs.
This makes the templates link up correctly in the admindocs.
2012-06-26 21:45:45 -05:00
Jannis Leidel c4c7fbcc0d Fixed #18451 -- Vastly improved class based view documentation.
Many thanks to Daniel Greenfeld, James Aylett, Marc Tamlyn, Simon Williams, Danilo Bargen and Luke Plant for their work on this.
2012-06-11 10:40:23 +02:00
Anssi Kääriäinen 484fcd34a4 Fixed #16418 -- Made generic views work with ModelForms
Generic views assumed any object's _meta will be model Options. This
is not true for ModelForms for example. Took isinstance(obj, Model)
in use instead.
2012-06-09 01:12:14 +03:00
Claude Paroz 4a103086d5 Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
2012-06-07 18:08:47 +02:00
Julien Phalip f699641161 Fixed #17138 -- Made the sensitive_variables decorator work with object methods. 2012-06-03 23:44:13 -07:00
Claude Paroz 2042f537a6 Removed unneeded smart_str in generic views. 2012-05-24 23:55:50 +02:00
Aymeric Augustin 3b2993ed04 Fixed #18353 -- Inconsistency in date-based CBVs. 2012-05-24 13:02:19 +02:00
Claude Paroz ed7ea5a602 Fixed #18113 -- Corrected get_template_names docstrings.
Thanks Keryn Knight for the report.
2012-05-22 13:15:28 +02:00
Aymeric Augustin 03f86a5adb Fixed #18354 -- Performance issue in CBV.
Prevented repeating a query twice when the model isn't ordered by
-date_field (in Meta), allow_empty is False and pagination isn't
enabled.
2012-05-20 13:18:42 +02:00
Claude Paroz 38408f8007 Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
2012-05-19 17:43:34 +02:00
Aymeric Augustin 20e6973682 Fixed #18323 -- Refactored date arithmetic
in date based generic views, in order to deal properly with both
DateFields and DateTimeFields.
2012-05-17 17:41:37 +02:00
Aymeric Augustin c4996df16c Fixed #17449 -- Added OPTIONS to generic views.
Thanks estebistec for the report and patch.
2012-05-17 13:54:51 +02:00
Aymeric Augustin 009e237cf0 Fixed #17535 -- Optimized list generic views.
When allow_empty is False, prevented the view from loading
the entire queryset in memory when pagination is enabled.
2012-05-17 13:34:53 +02:00
Aymeric Augustin fcb09b5746 Fixed #10890: added prev/next_week in the context
of per-week date-based generic views. Thanks ee_lars for the report.
2012-05-14 22:40:45 +02:00
Claude Paroz 865cd35c9b Made more extensive usage of context managers with open. 2012-05-05 14:06:36 +02:00
Aymeric Augustin e84f79f051 Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
2012-05-03 15:27:01 +02:00
Aymeric Augustin 78ba9670af Fixed #18217 -- Time zone support in generic views
Introduced a distinct implementation depending on the type of the
date field (DateField or DateTimeField), and applied appropriate
conversions is the latter case, when time zone support is enabled.
2012-04-30 20:48:19 +02:00
Aymeric Augustin e4d4cb6130 Simplified date-based generic views.
Removed a confusing helper function that was confusing -- it used
last_day to store the first day of the next month.
2012-04-30 14:45:25 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Matthew Tretter 97502a96f4 Correct reference error (undefined variable) 2012-04-28 15:32:22 -04:00
Tom Terrace a0d34348dd fix typo: instanciating -> instantiating 2012-04-28 14:18:16 -03:00
Claude Paroz 1858e47672 Fixed #18033 -- Removed function-based generic views, as per official deprecation timeline. Rest in peace! Thanks Anssi Kääriäinen for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17937 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-25 19:17:47 +00:00
Aymeric Augustin 28e5b66518 Fixed #18087 -- Prevented date-based generic views from loading entire tables in memory when pagination is enabled.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17893 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-10 20:05:46 +00:00
Claude Paroz 8663bc1103 Fixed #16074 -- Added ContextMixin to class-based generic views to handle get_context_data. Thanks emyller, Luke Plant, Preston Holmes for working on the ticket and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-06 21:24:33 +00:00
Claude Paroz 9383a2761c Removed with_statement imports, useless in Python >= 2.6. Refs #17965. Thanks jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-30 08:02:08 +00:00
Claude Paroz c7cc4cfb9e Fixed #16138 -- Made FormMixin get_initial return a copy of the 'initial' class variable. Thanks hanson2010, wilfred@potatolondon.com and agriffis for their work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-17 22:31:03 +00:00
Jannis Leidel b403e43c51 Updated core base translation files with new strings. Refs #17822.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17655 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-05 02:23:17 +00:00
Jannis Leidel 4887a8de17 Fixed #16842 -- Modified the RedirectView to correctly handle query strings with percent symbols. Thanks, accuser, jamey@minilop.net and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-02 16:55:56 +00:00
Paul McMillan a3bb4df895 Improved CSRF error message.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17570 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-21 23:54:02 +00:00
Aymeric Augustin 52b06e29c7 Prevented the generic views from automatically creating a HEAD method when there is no GET. Reverts r16105, refs #17449.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-18 09:50:03 +00:00
Jannis Leidel 55aa285a33 Fixed #17643 -- Set a better stack level for the cache_page decorator deprecation warnings. Thanks, zsiciarz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:59:12 +00:00
Jannis Leidel ec5e2f0ccc Fixed #17460 -- Extended the HIDDEN_SETTINGS constant in with a few more sensible names of settings to hide in the debug view. Many thanks to chomik, lpiatek and tomaszrybak.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:58:45 +00:00
Jannis Leidel f0a1633425 Fixed #17358 -- Updated logging calls to use official syntax for arguments instead of string interpolation. Thanks, spulec.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17480 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:58:36 +00:00
Jannis Leidel 4b71c9998e Fixed #15840 -- Wrapped inner function of the condition decorator with functools.wraps to follow best practices. Thanks, zsiciarz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:57:06 +00:00
Jannis Leidel 170e5d5f74 Fixed #17458 -- Marked Http404 error messages for translation. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 21:01:11 +00:00
Aymeric Augustin 9cce7a5ea8 Fixed #17486 -- Updated the welcome page of new projects to reflect the new structure created by startproject. Thanks aashu_dwivedi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17323 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-01 21:54:33 +00:00
Adrian Holovaty 98c974c70b Fixed super-edge-case bug in debug view where exc_value.args was empty. I managed to trigger this in some template code
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17245 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-22 22:08:32 +00:00
Adrian Holovaty 20c8aa2a20 Fixed various dodgy behaviours
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17 17:37:24 +00:00
Adrian Holovaty 8767439af4 Converted some of the built-in views to use content_type instead of mimetype HttpResponse argument. Refs #16519
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17 03:53:25 +00:00
Adrian Holovaty 913b39b37f Fixed #17422 -- Changed BaseDetailView to use *args, to be consistent with other views
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17216 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17 02:16:52 +00:00
Aymeric Augustin 98b08bd4d4 Upgraded the date based generic views to avoid warnings when time zone support is enabled.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-20 15:34:08 +00:00
Julien Phalip 4d79083453 Fixed #17111 -- Made the `redirect_to` generic view properly handle query strings with percent symbols. Thanks, Chris Adams.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17034 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-26 06:33:13 +00:00
Julien Phalip 99512d3544 Fixed #16918 -- Ensured that custom querysets are used when provided to `BaseDateDetailView.get_object()`. Thanks to mitar for the report, to koenb for the patch and to Preston Holmes for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 13:38:38 +00:00
Aymeric Augustin e2f9c11736 Fixed #16705 - Made the test client adhere to the WSGI spec -- in particular, removed the assumption that environ['QUERY_STRING'] exists.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-06 20:39:15 +00:00
Ramiro Morales 0d9b6a5bc4 Fixed #10841 -- Switched response served when DEBUG=True and request.is_ajax() returns True (indicating request has been generated by a JS library) to a plain text version for easier debugging.
Contents of this response are similar to its HTML counterpart modulo frame variables values in the Python traceback section.

Thanks to Riz for the report, to SmileyChris for the patch and to Julien for reviewing.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-02 02:53:58 +00:00
Carl Meyer 4397c587a4 Fixed #16770 -- Eliminated TemplateSyntaxError wrapping of exceptions. Thanks to Justin Myles-Holmes for report and draft patch.
Exceptions raised in templates were previously wrapped in TemplateSyntaxError
(in TEMPLATE_DEBUG mode only) in order to provide template source details on
the debug 500 page. The same debug information is now provided by annotating
exceptions rather than wrapping them. This makes catching exceptions raised
from templates more sane, as it's consistent in or out of DEBUG, and you can
catch the specific exception(s) you care about rather than having to also catch
TemplateSyntaxError and unwrap it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-16 01:16:25 +00:00
Jannis Leidel fb590bfa9b Replaced `has_key()` calls with `in` to ease Python 3 port. Thanks, Martin von Löwis.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-09 19:33:40 +00:00
Malcolm Tredinnick d661cc5e3a Pre-formatted text wrapping change in technical debug page.
In (typically rare) cases, a very long exception line can appear that
requires horiztonal scrolling in the cut-and-paste exception layout box.
To make this fractionally more readable, we pre-wrap the text now.

Fixes #16331, based on a patch from Trinh Hai-Anh.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-22 00:12:51 +00:00
Jannis Leidel 1ca6e9b9e2 Fixed #9847 -- Added 403 response handler. Many thanks to kgrandis, adamnelson, vkryachko, fvox13 and Chris Beaven.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16606 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-12 14:15:31 +00:00
Jannis Leidel 2ccfb6d5c2 Fixed #16101 -- Added parameters to SingleObjectMixin to override the name of the URL keyword arguments used for pk and slug. Thanks, Andrew Ingram and Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16569 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 09:41:00 +00:00
Jannis Leidel dc2bfae1e5 Fixed #16531 -- Fixed various instances of "undefined name" issues. Thanks, Bruno Renié.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16557 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29 09:39:35 +00:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Ramiro Morales c43d15b3b3 More removal of poorly legible constructs to workaround Python 2.4 shortcomings.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16363 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-10 18:43:29 +00:00
Luke Plant db2f9bfae1 Fixed #16178 - Cleanup request classes' `__repr__()`
Thanks to julien for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16350 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09 23:15:42 +00:00
Idan Gazit 716601109a Fixed #11834 -- Improved technical 500 stacktrace display.
Thanks to buriy and Aleksandra for the implementation!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16343 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09 12:45:11 +00:00
Luke Plant 45e55b9143 Fixed #14614 - filtering of sensitive information in 500 error reports.
This adds a flexible mechanism for filtering what request/traceback
information is shown in 500 error emails and logs. It also applies
screening to some views known to be sensitive e.g. views that handle
passwords.

Thanks to oaylanc for the report and many thanks to Julien Phalip for the
patch and the rest of the work on this.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16339 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-08 22:18:46 +00:00
Luke Plant bb12a02bd8 Deprecated legacy ways of calling cache_page
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-08 11:12:01 +00:00
Luke Plant 524c5fa07a Fixed #14261 - Added clickjacking protection (X-Frame-Options header)
Many thanks to rniemeyer for the patch!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-30 22:27:47 +00:00
Alex Gaynor 20fbfbadcd Explicitly close a file in the static serve view. Thanks to Benjamin Peterson for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-27 04:06:23 +00:00
Luke Plant 71a7466dd6 Fixed #16009 - typo in CSRF_FAILRE_TEMPLATE.
Thanks to adehnert for report and patch.

Though I flail to see what problem it was causing...

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16216 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-12 03:03:16 +00:00
Luke Plant b6c5f8060d Fixed #15354 - provide method to ensure CSRF token is always available for AJAX requests
Thanks to sayane for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-09 21:35:24 +00:00
Jannis Leidel 0b1a061881 Replaced old-style with new-style decorator syntax.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-01 16:46:02 +00:00
Jannis Leidel 086ab44336 Fixed #15637 -- Added a require_safe decorator for views to accept GET or HEAD. Thanks, aaugustin and Julien.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-28 13:04:16 +00:00
Alex Gaynor 2f9c52dc90 Fixed a failing test in special_headers, and performed a bit of cleanup.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-26 16:56:17 +00:00
Luke Plant f4c808b7f5 Fixed #15688 - Generic views should provide a HEAD implementation
Thanks to j4mie for the report and patch!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16095 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-23 15:10:51 +00:00
Jannis Leidel 598032b8c4 Fixed #15698 -- Fixed inconsistant handling of context_object_name in paginated MultipleObjectMixin views. Thanks, Dave Hall.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16079 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22 12:03:58 +00:00
Luke Plant fda8a9a390 Fixed case of DOCTYPE in 500 template, for the sake of consistency.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20 17:44:29 +00:00
Luke Plant 26cda43012 Switched to HTML5 doctype in all Django supplied templates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20 17:40:53 +00:00
Andrew Godwin 4d3ab063b1 Fixed #15613: Don't send content-length headers for non-regular files. Thanks to jaylett.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-04 12:39:21 +00:00
Ramiro Morales ecdcf477f9 Removed support code for deprecated module-based template loaders from debug view postmortem.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 18:48:18 +00:00
Russell Keith-Magee 62f37c69b0 Fixed #15739 -- Added support to RedirectView for HEAD, OPTIONS, POST, PUT and DELETE requests
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:45:22 +00:00
Russell Keith-Magee 603884505f Advanced deprecations for function-based generic views
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:44:04 +00:00
Luke Plant 16f6acdb89 Deprecated csrf_response_exempt and csrf_view_exempt decorators
With the removal of CsrfResponseMiddleware, csrf_response_exempt serves no
purposes, and csrf_exempt and csrf_view_exempt perform the same function.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-30 17:35:41 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Russell Keith-Magee 87a100b642 Fixed #15575 -- Corrected handling of pagination in generic views to match documentation and historical behavior. Thanks to Ivan Virabyan for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15820 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-15 08:24:31 +00:00
Karen Tracey f1f10a9ce2 Fixed #15597: When formatting the debug page for inclusion in an e-mail, suppress the note about "seeing this" because DEBUG is True.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-14 14:58:54 +00:00
Russell Keith-Magee 299874cbe1 Fixed #15560 -- Cleaned up some redundant post->put redirections in the class-based generic views. Thanks to maney for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-06 05:55:12 +00:00
Jannis Leidel 6b95aa6fb5 Fixed #15531 -- Partially reverted [15701] due to compatibility issues with 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-02 10:40:48 +00:00
Jannis Leidel be4a2e3f3e Fixed #15281 -- Made the static view use an iterator when serving a file, 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-01 22:49:10 +00:00
Luke Plant dbe6ced0d6 Fixed #717 - If-Modified-Since handling should compare dates according to 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-03-01 14:28:06 +00:00
Russell Keith-Magee 312d2f3edd Fixed #15508 -- Corrected a misleading error message in the DetailView generic view. Thanks to varikin for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-26 05:37:35 +00:00
Russell Keith-Magee 64b042bb3c Fixed #15247 -- Ensured that if a SingleObject view defines get_object but not get_queryset, the ModelFormMixin doesn't fail. Thanks to Sergey N. Belinsky for the report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15540 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-15 08:12:29 +00:00
Russell Keith-Magee 72e4a6865d Fixed #15287 -- Added translation markers to user-facing error messages in class-based generic views. Thanks to szczav for the report and draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 13:05:31 +00:00
Russell Keith-Magee bb26c328ec Fixed #15298 -- Raise a better error when a TemplateResponseMixin doesn't have a template_name defined. Thanks to rasca for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15532 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 13:05:14 +00:00
Russell Keith-Magee 06b22963ea Fixed #15272 -- Altered generic views to use the guaranteed untranslated object_name, rather than the possibly translated verbose_name(_plural) for default context objects. Thanks to szczav for the report and patch.
This is BACKWARDS INCOMPATIBLE for anyone relying on the default context object names for class-based Detail and List views. To migrate, either update your templates to use the new default names, or add a context_object_name argument to your generic views.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 13:04:51 +00:00
Jannis Leidel a26034ffbf Fixes #15270 -- Moved back the serve view to django.views.static due to 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
2011-02-14 01:42:26 +00:00
Ramiro Morales f6e38f3800 Fixed #5494, #10765, #14924 -- Modified the order in which translations are read when composing the final translation to offer at runtime.
This is slightly backward-incompatible (could result in changed final translations for literals appearing multiple times in different .po files but with different translations).

Translations are now read in the following order (from lower to higher priority):

For the 'django' gettext domain:

 * Django translations
 * INSTALLED_APPS apps translations (with the ones listed first having higher priority)
 * settings/project path translations (deprecated, see below)
 * LOCALE_PATHS translations (with the ones listed first having higher priority)

For the 'djangojs' gettext domain:

 * Python modules whose names are passed to the javascript_catalog view
 * LOCALE_PATHS translations (with the ones listed first having higher priority, previously they weren't included)

Also, automatic loading of translations from the 'locale' subdir of the settings/project path is now deprecated.

Thanks to vanschelven, vbmendes and an anonymous user for reporting issues, to vanschelven, Claude Paroz and an anonymous contributor for their initial work on fixes and to Jannis  Leidel and Claude for review and discussion.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-07 18:48:40 +00:00
Russell Keith-Magee d89ad6423c Fixed #14711 -- Corrected the calculation for the previous month in generic date views. Thanks to msundstr for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-06 06:31:52 +00:00
Russell Keith-Magee d44fb0557a Fixed #14824 -- Corrected the handling of formats when USE_L10N is disabled. Thanks to nullie for the report and initial patch, and to idle for the separate report with helpful debug info.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15404 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-04 13:52:36 +00:00
Russell Keith-Magee 9a82eb6ff1 Fixed #14972 -- Ensure that the HTML email logger always produces useful output, regardless of whether it has been given an exception or a request. Thanks to jamstooks for the report, and bpeschier for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-01 14:18:07 +00:00
Ramiro Morales 4392c8e67e Fixed #15158 -- Fixed error introduced in r15252 in rendering of the template post morten section of the 500 error debug page with loaders other than the file system or application dir loaders. Refs #15122. Thanks gsf for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-29 15:03:39 +00:00
Russell Keith-Magee 461f01b7a6 Fixed #15061 -- Removed a redundant method implementation in the class-based ModelFormMixin, and did some PEP8 cleanup. Thanks to rasca for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-27 03:14:20 +00:00
Alex Gaynor b4bf635cea Fixed #15052 -- corrected an innacurate docstring in the generic views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15315 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-26 03:23:59 +00:00
Russell Keith-Magee 3d7afd5d2b Fixed #15021 -- Corrected CSS for the layout of stack traces on the server error page. Thanks to EmilStenstrom for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15294 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-24 11:49:11 +00:00
Ramiro Morales 19bfdadc43 Fixed #15122 -- Restored reporting of the template files tried in the texmplate loader post mortem section of the TemplateDoesNotExit 500 error debug page. Thanks rdrey for reporting this regression.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-20 22:33:58 +00:00
Luke Plant 80f4826063 Fixed #15025 - template debug fails if there's a callable local var that generates an exception
Thanks to Tai Lee for the patch and report, also to Don Spaulding.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-13 13:47:03 +00:00
Andrew Godwin 1ad644c0f0 Fixed #14929 -- Move gzip_page docstring to the right place. Thanks adamv.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08 14:55:19 +00:00
Andrew Godwin 4a9ecdb148 Fixed #14995 -- Add FormView import to generic views __init__. Thanks carbonXT.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08 14:53:44 +00:00
Andrew Godwin 32a344dfe2 Fixed inconsistency in ListView's pagination (short datasets should also trigger a pagination, but with a single possible page)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08 13:15:44 +00:00
Russell Keith-Magee a00e8d4e42 Fixed #14878 -- Clarified the way verbose_name_plural is used in generic list views as a context variable. Thanks to diegueus9 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-03 13:15:58 +00:00
Andrew Godwin f9fba51164 Fix a small docstring bug in the CSRF decorators.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-22 21:49:20 +00:00
Russell Keith-Magee 673e6fc7fb Fixed #11675 -- Added support for the PyLibMC cache library. In order to support this, and clean up some other 1.3 caching additions, this patch also includes some changes to the way caches are defined. This means you can now have multiple caches, in the same way you have multiple databases. A huge thanks to Jacob Burch for the work on the PyLibMC backend, and to Jannis for his work on the cache definition changes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 15:19:19 +00:00
Jannis Leidel 6ec348fb41 Fixed #13726 -- Further refine changes made in r12384 and r13069 for using non-English source languages in JavaScript translation catalogues. Thanks, Ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-13 13:52:52 +00:00
Jannis Leidel 6261593b99 Fixed #11990 -- Show the correct URLconf in the technical 404 template even if it was overridden, e.g. in a middleware. Thanks, mattbennett.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-12 22:54:04 +00:00
Chris Beaven 2e909489d7 Add FormMixin.get_form_kwargs method to abstract some common logic in a tidier
way. Tidy up (and amend) documentation about FormMixin and ModelFormMixin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-10 03:51:30 +00:00
Chris Beaven ff8711a825 Fixes #14873 -- A paginated ListView with a List instead of queryset produces an error.
Additional minor change in functionality: the page is now not considered paginated if the objects do not span multiple pages according to the paginator. This will only affect views with a custom paginator method which uses orphans.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-09 02:34:14 +00:00
Russell Keith-Magee e0dcd7666a Fixed #12815 -- Added TemplateResponse, a lazy-evaluated Response class. Thanks to Simon Willison for the original idea, and to Mikhail Korobov and Ivan Sagalaev for their assistance, including the draft patch from Mikhail.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-07 13:57:01 +00:00
Russell Keith-Magee 29c4a578af Fixed #10863 -- Added HTML support to mail_managers() and mail_admins(), and used this to provide more and prettier detail in error emails. Thanks to boxed for the suggestion, and to Rob Hudson and Brodie Rao for their work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-06 14:21:51 +00:00
Russell Keith-Magee ee48da2405 Fixed #14773 -- Modified MultipleObjectMixin to allow for custom paginators. Thanks to piquadrat for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-05 04:32:36 +00:00
Russell Keith-Magee adfd7f8172 Fixed #14797 -- Corrected the handling of get_form_class() when a custom queryset has been defined, but a model hasn't. Thanks to Gabriel Grant for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 11:20:52 +00:00
Russell Keith-Magee 324658ef26 Fixed #14803 -- Corrected an inconsistency in redirection handling between old-style generic views and class-based views. Thanks to gg for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 11:20:30 +00:00
Russell Keith-Magee 6770c36262 Fixed #14737 -- Moved the docstring comment for the cache_page decorator so it gets picked up as a docstring. Thanks to adamv for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 06:49:51 +00:00
Russell Keith-Magee 2efb4757af Fixed #14752 -- Corrected date parsing in WeekArchiveView when using %W as a week format. Thanks to msundstr for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-23 01:46:48 +00:00
Luke Plant d4c6abcbd1 Documented migration path for change object_list -> ListView regarding different context variables
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-20 20:38:52 +00:00
Russell Keith-Magee 591ad8afbf Fixed #14512 -- Added documentation on how to apply decorators to class-based generic views. Thanks to Łukasz Rekucki for his work on the issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-20 05:10:13 +00:00
Jannis Leidel 33d8fcde8a Fixed #14693, #14709 -- Backwards incompatible change to rectify the 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-17 15:36:26 +00:00
Jannis Leidel 8e96584f63 Fixed #14524, #14582, #14617, #14665 and #14667 -- Tweaked staticfiles app.
* 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-11-11 21:43:49 +00:00
Jannis Leidel 83aeb3c768 Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04 10:48:27 +00:00
Luke Plant 90ac02300e Fixed #14565 - No csrf_token on 404 page.
This solution doesn't have the negative side-effects of [14356].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 11:47:15 +00:00
Luke Plant 144ab8877f Reverted changeset [14356]
That fix for #14565 introduced test failures.  A better fix will
follow shortly.

Refs #14565

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14376 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 11:46:57 +00:00
Russell Keith-Magee 4c9741cba2 Fixed #14558 -- Modified the way PUT and DELETE HTTP methods are handled so that overridden methods will get used correctly. Thanks to pyrou for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:59:04 +00:00
Russell Keith-Magee 623592e0ac Fixed #14554 -- Raise the actual NotImplementedError exception, not the NotImplemented comparison value. Thanks to mattmcc for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:46 +00:00
Russell Keith-Magee baa1e90d4c Fixed #14504 -- Corrected the way object_list is used in ListView to avoid overwriting context. Includes improved usage of unittest2 assertions. Thanks to Łukasz Rekucki for the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:28 +00:00
Russell Keith-Magee 8bc2f2a0b5 Fixed #14568 -- Use keyword rather than positional arguments for form construction. Thanks to mattmcc for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:06 +00:00
Luke Plant 851f42ba27 Fixed #14565 - No csrf_token on 404 pages
Thanks to gvangool for report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-26 18:09:20 +00:00
Jannis Leidel cfc19f84de Fixed #12323 and #11582 -- Extended the ability to handle static files. 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-10-20 01:33:24 +00:00
Russell Keith-Magee a014ee0288 Modified the implementation of get_object() to be consistent with the approach used elsewhere in the API. Also added documentation for get_object() which seems to have been accidentally omitted.
This is a BACKWARDS-INCOMPATIBLE CHANGE for anyone depending on the API for get_object() that was introduced (but not documented) in r14254.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-20 00:21:47 +00:00
Honza Král 1a270bd103 Fixed #14495 -- DeletionMixin and FormMixin don't have an object to work with so they cannot redirect to get_absolute_url and shouldn't claim they do.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14284 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-19 07:22:38 +00:00
Russell Keith-Magee 3ecc84a83c Added a logging call on HTTP 405 for class-based views. This is for consistency with function-based views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-19 00:26:15 +00:00
Russell Keith-Magee 0fcb094557 Fixed #6735 -- Added class-based views.
This patch is the result of the work of many people, over many years.
To try and thank individuals would inevitably lead to many people
being left out or forgotten -- so rather than try to give a list that
will inevitably be incomplete, I'd like to thank *everybody* who
contributed in any way, big or small, with coding, testing, feedback
and/or documentation over the multi-year process of getting this into
trunk.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18 13:34:47 +00:00
Russell Keith-Magee a904e55859 Fixed #11509 -- Modified usage of "Web" to match our style guide in various documentation, comments and code. Thanks to timo and Simon Meers for the work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-09 08:12:50 +00:00
Russell Keith-Magee fea159282b Fixed #14406 -- Added a Python 2.4 compatibility to the logging interface. Thanks to Łukasz Rekucki for the report, and to Luke Plant for original patch this was based on.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-06 15:02:26 +00:00
Russell Keith-Magee 24acca4139 Fixed #12012 -- Added support for logging. Thanks to Vinay Sajip for his draft patch, and to the many people who gave feedback during development of the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04 15:12:39 +00:00
Jannis Leidel 94096e83e9 Fixed #12544 and #13600 -- Fixed static files serving view to catch invalid 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-26 20:44:56 +00:00
Jannis Leidel a686096c26 Fixed #7535 -- Correctly set Content-Encoding header in static files serving 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-09-26 15:10:41 +00:00
Luke Plant 9d6eeeec39 Fixed #12019 - backwards compatibility issues with cache_page decorator.
Thanks to rokclimb15 for the report, and j4mie/rokclimb15 for the patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-21 19:32:22 +00:00
Malcolm Tredinnick 882cba0f69 Debug 404 page now displays names of URL patterns, if they exist.
Thanks to Tobias McNulty for the patch. Fixed #9310.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 19:27:33 +00:00
Malcolm Tredinnick fffe0a00a3 Add option to redirect_to view to allow passing along the query string
from the original request. Default is current behaviour, which is not to
pass the query string (it often won't be appropriate to do so).

Thanks to steingrd@ifi.uio.no for the patch and tests. Fixed #9966.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 03:13:23 +00:00
Malcolm Tredinnick a56a226241 Display a repr-like result for safe-string local variables on the debug page.
Fixed #7697. Thanks, SmileyChris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 02:02:20 +00:00
Luke Plant e8cff0b8f3 Added explanatory note on CSRF failure page for the case of a missing Referer header.
This is intended to help power users who have disabled Referer headers, or
installed add-ons which have done so, and to help web site administrators
with debugging, since this problem will be browser specific and not a
programming error.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-03 16:28:10 +00:00
Jacob Kaplan-Moss 2311bcbd01 Fixed #13624: added SIGNATURE to the list of settings to hide on debug pages.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13315 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-28 17:25:43 +00:00
Luke Plant 6b2d6e1833 Fixed #13590 - Made CSRF failure page styling consistent with Django's default error page styling.
Thanks to alefteris for suggestion.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-22 18:42:16 +00:00
Russell Keith-Magee 21e84194b5 Fixed #13514 -- Corrected the process of loading multiple javascript translation catalogs. Thanks to jtiai for the report, to Ramiro Morales for working out the test case, and to Ramiro and Jannis for their help on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-13 13:29:31 +00:00
Russell Keith-Magee 5211f48ae3 Fixed #12164 -- Removed the Python 2.3 compatibility imports and workarounds. Thanks to timo and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04 14:00:30 +00:00
Jannis Leidel 43bf086783 Fixed #13388 - Refined changes made in r12384 in the JavaScript i18n admin view.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-02 19:46:31 +00:00
Russell Keith-Magee 615eab6b02 Fixed #13093 -- Updated some decorators and the decorator_from_middleware function to allow callable classes to be decorated. Thanks to Brian Neal for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12762 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-12 13:06:13 +00:00
Karen Tracey eb11229ba7 Fixed #12083: Ensured generating debug 404 page won't raise a key error. Thanks pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-05 18:53:07 +00:00
Joseph Kocherhans 83e52e3162 Fixed #10216. Only try to gather template exception info if the exception is a Django TemplateSyntaxError. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-24 21:58:01 +00:00
Joseph Kocherhans 3304afa67a Fixed #12944. Added Django version to the main part of the debug page. Thanks, robhudson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-24 19:39:04 +00:00
Luke Plant 4bff194633 Fixed #12804 - regression with decorating admin views.
This is a BACKWARDS INCOMPATIBLE change, because it removes the flawed
'auto_adapt_to_methods' decorator, and replaces it with 'method_decorator'
which must be applied manually when necessary, as described in the 1.2
release notes.

For users of 1.1 and 1.0, this affects the decorators:

 * login_required
 * permission_required
 * user_passes_test

For those following trunk, this also affects:

 * csrf_protect
 * anything created with decorator_from_middleware 

If a decorator does not depend on the signature of the function it is
supposed to decorate (for example if it only does post-processing of the
result), it will not be affected.
 



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-09 15:02:39 +00:00
Jannis Leidel 8600ad4c50 Fixed #3594 - Added ability to discard the language catalog in the JavaScript i18n view in case the selected language is English but no English translation catalog actual exists, e.g. due to being the language translated from. Thanks to msaelices, aryx and Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-05 01:43:13 +00:00
Russell Keith-Magee 1f305a00a0 Fixed #12744 -- Improved the settings cleansing process the work with dictionary settings that are keyed by non-strings. Thanks to minmax for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-31 23:38:17 +00:00
Russell Keith-Magee ee3132078d Fixed #12736 -- Fixed the debug page to hide passwords when they are in dictionary structures (like the new DATABASES setting). Thanks to Karen for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-31 02:30:02 +00:00
Karen Tracey b45fd3ffdf Fixed: 3274: Added date_list context variable to the archive_month generic view, consistent with archive_index and archive_year. Thanks Sean Brant.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 19:52:17 +00:00
Adrian Holovaty 5ceed0a053 Changed a whole bunch of places to raise exception instances instead of 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-10 18:36:20 +00:00
Jannis Leidel 8a109a7bc8 Fixed #11757 - Set mimetype when responding with HttpResponseNotModified in django.server.static.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 20:04:33 +00:00
Jannis Leidel f6c519e2b9 Fixed #12492 - Refactored JavaScript format localization by separating it from the translation backend. Thanks, Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 02:28:34 +00:00
Jannis Leidel fa0653cd1d Fixed #12454 - Added support for localized formats to admin date and time widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-30 22:12:16 +00:00
Jannis Leidel 6eb02fa9bb Fixed #12448 - Make sure format strings are handled correctly as unicode.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12028 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-30 22:11:11 +00:00
Jannis Leidel 9233d04265 Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.
Thanks to Marc Garcia for working on this during his Google Summer of Code 2009!

Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 17:58:49 +00:00
Russell Keith-Magee ff60c5f9de Fixed #1142 -- Added multiple database support.
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project.
Congratulations to Alex for a job well done.

Big thanks also go to:
 * Justin Bronn for keeping GIS in line with the changes,
 * Karen Tracey and Jani Tiainen for their help testing Oracle support
 * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback.
 * Malcolm Treddinick for his guidance during the GSoC submission process.
 * Simon Willison for driving the original design process
 * Cal Henderson for complaining about ponies he wanted.

... and everyone else too numerous to mention that helped to bring this feature into fruition.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 15:18:51 +00:00
Russell Keith-Magee 44b9076bbe Fixed #6262 -- Added a cached template loader, and modified existing template loaders and tag to be cacheable. Thanks to Mike Malone for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11862 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-14 12:08:23 +00:00
Luke Plant 25020ddb05 Fixed #4604 - Configurable message passing system, supporting anonymous users
This deprecates User.message_set in favour of a configurable messaging
system, with backends provided for cookie storage, session storage and
backward compatibility.

Many thanks to Tobias McNulty for the bulk of the work here, with
contributions from Chris Beaven (SmileyChris) and lots of code review from
Russell Keith-Magee, and input from many others.  Also credit to the authors
of various messaging systems for Django whose ideas may have been pinched
:-)



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-09 16:57:23 +00:00
Luke Plant 53b2c3867b Fixed #12130 - documented need for csrf_protect on views that don't accept POST
Includes:
   
 * proper documentation for csrf_protect
 * notes in comments app.
 * specific upgrade notes for comments app

Thanks to carljm for report and debugging.




git-svn-id: http://code.djangoproject.com/svn/django/trunk@11711 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-03 14:40:37 +00:00
Luke Plant c5c7791e91 Improved HTML in CSRF debug template - <code> instead of <tt>
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-29 14:17:39 +00:00
Luke Plant 5df19aa99e Small improvement to CSRF failure template.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11676 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-27 22:20:03 +00:00
Luke Plant 7230a995ce Moved contrib.csrf.* to core code.
There is stub code for backwards compatiblity with Django 1.1 imports.

The documentation has been updated, but has been left in
docs/contrib/csrf.txt for now, in order to avoid dead links to
documentation on the website.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-27 00:36:34 +00:00
Luke Plant 6e3a72585a Added 'key_prefix' keyword argument to cache_page()
This was available before r11586, but undocumented.  It has now been
re-added with documentation and explicit support, as it seems like a useful
feature and people were using it before.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-28 21:54:54 +00:00
Luke Plant a97648a7e0 Corrected regressions introduced in r11586 and r11593
I read the order of arguments in the docs incorrectly, doh!


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-26 19:39:42 +00:00
Luke Plant d6c2286712 Improved error messages when people use cache_page in undocumented and now unsupported ways.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-23 23:47:53 +00:00
Luke Plant afeafcd492 Fixed #6371 - several decorators don't work with bound methods.
This involved changing the way the internal function
decorator_from_middleware works slightly, breaking some code that relied on
the old behaviour.  As a result, it is much simpler, but cache_page has been
made slightly more complex to cope with the change.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-21 22:31:51 +00:00
Russell Keith-Magee bc5a7c0dbd Fixed #11512 -- Corrected unclosed tag in HTML on debug page. Thanks to rlaager for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-21 01:50:06 +00:00
Karen Tracey 50745cc31e Fixed #11066 -- Corrected 15 duplicate "the"s found in docs and code comments. Thanks kaikuehne.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-17 16:45:28 +00:00
Russell Keith-Magee 6cc0c3887c Fixed #10458 -- Corrected the `next_month` and `previous_month` context variables provided with the generic month_archive view. The value returned now matches the docstring and the generic views documentation. Thanks to fperetti for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 13:23:03 +00:00
Malcolm Tredinnick 54800be3a1 Fixed #9577 --Fixed URL display in the debug template.
Patch from Thomas Güttler.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10534 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 02:23:19 +00:00
Jacob Kaplan-Moss 641c5fd3b5 Fixed #7944: date-based generic views no longer get confused with a numeric month format. Thanks to Justin Lilly and Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10457 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-09 15:23:56 +00:00
Malcolm Tredinnick d2a8bc5b40 Fixed #10681 -- Work around (by ignoring) invalid ETag headers.
This is a hack to work around problems in the Real World. Apparently, Opera
9.64 has been observed sending malformed headers. We now compromise our high
principles and simply ignore such bad behaviour.

Patch from Ivan Sagalaev.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-03 06:59:34 +00:00
Jacob Kaplan-Moss cc5477df89 Fixed #7529: added a FILES section to the debug view. As a bonus, we've now got
the start of a suite of tests for the debug views. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 17:10:06 +00:00
Malcolm Tredinnick e5a8d9e810 A bunch of improvements for conditional HTTP processing.
Fixed some typos in the code (fixed #10586). Added more tests. Made the
tests compatible with Python 2.3. Improved the documentation by putting
the good news and common use-case right up front.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-24 03:01:46 +00:00
Malcolm Tredinnick 3bb68004ff Fixed #10581 -- Fixed conditional handling of If-Match headers.
The conditional processing decorator from r10114 wasn't parsing ETags
from an If-Match header correctly. Patch from Ivan Sagalaev (who also
did most of the work in r10114, before I rewrote parts of it and added
bonus bugs, although I forgot to thank him there).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-22 23:16:03 +00:00
Malcolm Tredinnick b203db6ec8 Fixed #5791 -- Added early-bailout support for views (ETags and Last-modified).
This provides support for views that can have their ETag and/or Last-modified
values computed much more quickly than the view itself. Supports all HTTP
verbs (not just GET).

Documentation and tests need a little more fleshing out (I'm not happy with the
documentation at the moment, since it's a bit backwards), but the functionality
is correct.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-22 07:58:29 +00:00
Jacob Kaplan-Moss c485e236bd Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 16:55:59 +00:00
Malcolm Tredinnick d32c290846 Revised r9566 slightly to be backwards compatible with versions 1.0 - 1.0.2.
Also documented the change. We prefer to load directory_index.html for static
directory listings, but if you have the (older style) "directory_index"
template and no .html version, we'll load that. This should stop a bunch of
mysterious breakages when people upgrade to Django 1.0.3 or Django 1.1. Also
keeps the docs in sync with released code.

Fixed #9993.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-09 12:41:07 +00:00
Adrian Holovaty b76d7c1dec Added a 'permanent' argument the simple.redirect_to() generic view. It's True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301. This is technically backwards-incompatible if you were using the redirect_to generic view with a format-string key called 'permanent', which is highly, highly unlikely.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 04:53:34 +00:00
James Bennett dfef20a780 Fixed #9754: static-serving view now uses correct template name for directory indexes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-04 19:33:28 +00:00
Adrian Holovaty 40cb11a554 Moved the bulk of the shortcut() function in django/views/defaults.py to a new module, django/contrib/contenttypes/views.py. As a result, django/views/defaults.py no longer relies on django.contrib.contenttypes. Of course, the shortcut() function is still available in the former module, for backwards compatibility. See the new FutureBackwardsIncompatibleChanges wiki page.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-10 05:56:34 +00:00
Adrian Holovaty 6bdb7b9529 Fixed #8172 -- Improved a whole bunch of contrib templates (admin, databrowse, admindocs, etc.) to remove unnecessary 'escape' filters, given autoescaping. Also removed unnecessary {% if %} tags and shortened some {% if %}/{% else %} tags to use {% firstof %}. Thanks for the patch, benspaulding
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-08 05:19:28 +00:00
Jacob Kaplan-Moss 887f778794 Fixed #8287: the debug page now shows the actual requested URL even if you've messed with request.path. Patch from Giuliani Vito Ivan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 19:59:29 +00:00
Jacob Kaplan-Moss ddb3cdd514 Fixed #6353: better handle unicode in exception reasons.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8560 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 22:47:07 +00:00
Brian Rosner a64dc39fb7 Fixed #7602 -- Corrected lookup keyword arguments in archive_month and archive_week to properly range when date_field is from DateField. Thanks nullie for the original patch and Colin Grady for the test coverage.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 04:46:33 +00:00
Russell Keith-Magee 15f8b4cde0 Fixed #8178: Another update to debug template to aid rendering of exception traces. Thanks to julianb for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8420 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-17 04:27:36 +00:00
Russell Keith-Magee 3afa4a4626 Fixed #8178: Cleaned up the rendering of exceptions on the error template. Thanks to Marinho Brandão for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 12:33:36 +00:00
Gary Wilson Jr ef48a3e69c Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead.
 * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead.
 * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively.
 * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively.
 * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead.
 * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively.
 * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead.
 * Support for importing `django.newforms` was removed. Use `django.forms` instead.
 * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead.
 * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 21:10:47 +00:00
Gary Wilson Jr 4774c8d673 Corrected spacing in warning message.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 17:25:37 +00:00
Gary Wilson Jr 020f965087 Fixed #7988 -- Corrected import of the warnings module, thanks richardh.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 17:24:35 +00:00
Adrian Holovaty 0894ddb2bb Fixed #7848 -- Removed a bunch of code that wasn't contributing to society. Thanks, julien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:26:25 +00:00
Adrian Holovaty 29f0e8182f Fixed #7847 -- Removed a whole bunch of unused imports from throughout the codebase. Thanks, julien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:24:09 +00:00
Jacob Kaplan-Moss 46786b4193 Fixed #7741: django.newforms is now django.forms. This is obviously a backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 01:22:26 +00:00
Gary Wilson Jr dc375fb0f3 Refs #3639 -- Minor docstring correction, it's a function not a method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 23:52:18 +00:00
Jacob Kaplan-Moss 7997133a3d Fixed #3639: updated generic create_update views to use newforms. This is a backwards-incompatible change.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 19:45:00 +00:00
Malcolm Tredinnick e7e4b8b0f7 Fixed #6862 -- Refactored debug traceback extraction into an easy-to-use class.
Aside from being a little easier to read and use, this means you could subclass
a request/response handler class (from django.core.handlers) to add your own
traceback extraction handling in non-DEBUG environments and reuse this code.
Thanks, Ned Batchelder.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-15 18:47:49 +00:00
Malcolm Tredinnick 409ed9468f Fixed #7670 -- Fixed a couple of missed changes from [7865]. Patch from jshaffer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 05:29:23 +00:00
Adrian Holovaty 4406d283e1 Fixed #7478 -- Rolled QuerySetPaginator into the Paginator class, to simplify things. QuerySetPaginator still exists as an alias, for backwards compatibility. Thanks for the suggestion, batiste@dosimple.ch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 02:08:33 +00:00
Adrian Holovaty b0d380376c Fixed #7649 -- Fixed incorrect line numbering in debug view in case of empty spaces. Thanks, dusk
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7863 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 01:49:50 +00:00
Adrian Holovaty 16482911fd Fixed #7127 -- Fixed incorrect docstring for page_not_found() view. Thanks, kcarnold and Simon Greenhill
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-16 03:41:03 +00:00
Malcolm Tredinnick eb6a6c4619 Fixed #6864 -- Handle Javascript i18n when the plural form expression returns
True or False (so both booleans and integers are allowed). Thanks, Ramiro Morales.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-24 13:27:19 +00:00
Malcolm Tredinnick 0fea1348d6 Fixed #6846 -- Fixed first_on_page and last_on_page in list_detail generic
view. Thanks, trevor.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-23 05:45:59 +00:00
Malcolm Tredinnick c01e6b852a Fixed #6486 -- Added local server time to the debug output page. Patch from
Bastian Kleineidam and Thomas Güttler.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 07:01:26 +00:00
Adrian Holovaty c016352229 Fixed #5935 -- the 'It worked' page is now served with a 200 status code, not a 404. Thanks for bringing this up, Free Neuron
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7310 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 22:21:04 +00:00