Commit Graph

760 Commits

Author SHA1 Message Date
Tim Graham aa93a1890f Removed contrib.comments per deprecation timeline. 2014-03-21 07:05:36 -04:00
Claude Paroz 210d0489c5 Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
2014-03-08 09:57:40 +01:00
Sergey Kolosov 8c98f39624 Fixed #15318 -- Added settings for language cookie max-age, path, domain
Introduced a number of settings to configure max-age, path, and domain
for the language cookie: LANGUAGE_COOKIE_AGE, LANGUAGE_COOKIE_PATH and
LANGUAGE_COOKIE_DOMAIN.

Thanks sahid for the suggestion.
2014-03-01 07:52:45 -05:00
Marcin Sokół b887408486 Fixed #22113 -- changed object_name to model_name in CBV docs.
Thanks to trac user nikunj.sg for the report.
2014-02-22 23:36:54 +01:00
Erik Romijn 8cd32f0965 Fixed #22120 -- Documented persistent activation of languages and cleaned up language session key use 2014-02-22 18:29:06 +01:00
Alex Gaynor cd7f37b647 Corrected a pair of flake8 violations 2014-02-15 10:42:12 -08:00
Grzegorz Nosek 0b6f9f7c6f Improved fix for #18373 -- backward compatibility
Commit 79558c78 cleaned up the (undocumented) interface of Resolver404
exception, which breaks compatibility with code messing with .args[0]
directly. Revert the cleanup part and simply leave the fix itself.
2014-02-15 17:51:18 +01:00
Tim Graham 65b421c661 Fixed some flake8 errors from recent commits. 2014-02-15 11:21:15 -05:00
Grzegorz Nosek 79558c787e Fixed #18373 - improved handling of Resolver404s from views
When django.core.urlresolvers.resolve was called from a view, failed
and the exception was propagated and rendered by technical_404_response,
the URL mentioned on the page was the current URL instead of the URL
passed to resolve().

Fixed by using the path attribute from the Resolver404 exception instead
of request.path_info. Also cleaned up the exceptions to use standard
named parameters instead of stuffing a dict in args[0]
2014-02-15 15:56:04 +01:00
Ryan Kaskel 75a96f06e9 Fixed #21967: Added check for object in ModelFormMixin.get_form_kwargs.
Thanks lagovas.lagovas at gmail.com for the report.
2014-02-09 06:30:03 -05:00
Berker Peksag 5d263dee30 Fixed #21674 -- Deprecated the import_by_path() function in favor of import_string().
Thanks Aymeric Augustin for the suggestion and review.
2014-02-08 11:12:19 -05:00
Aymeric Augustin 9ffab9cee1 Moved RequestSite and get_current_site.
Following the app-loading refactor, these objects must live outside of
django.contrib.sites.models because they must be available without
importing the django.contrib.sites.models module when
django.contrib.sites isn't installed.

Refs #21680. Thanks Carl and Loic for reporting this issue.
2014-01-26 08:50:47 +01:00
Michael Blatherwick 270c9fe488 Fixed typo in docstrings of MonthArchiveViews. 2014-01-10 08:25:22 -05:00
Aymeric Augustin c81fae6b95 Used app_label instead of appname.
The last component of the dotted path to the application module is
consistently referenced as the application "label". For instance it's
AppConfig.label. appname could be confused with AppConfig.name, which is
the full dotted path.
2013-12-28 09:53:02 +01:00
Aymeric Augustin 1716b7ce5a Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry".

Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-24 12:25:17 +01:00
Aymeric Augustin 2fef9e5375 Moved apps back in the toplevel django namespace.
Reverted 4a56a93cc4.
2013-12-22 11:39:55 +01:00
Aymeric Augustin 65cd74be8e Stopped iterating on INSTALLED_APPS.
Used the app cache's get_app_configs() method instead.
2013-12-22 11:39:18 +01:00
Baptiste Mispelon e2f142030b Fixed #21564 -- Use local request object when possible in generic views.
Thanks to trac user adepue for the report and original patch.
2013-12-16 16:58:08 +01:00
Peter Harley cdd6617da6 Fixed #21619 -- Made SingleObjectMixin.get_object catch a more precise exception.
Thanks to Keryn Knight for the report.
2013-12-15 21:49:52 +01:00
Baptiste Mispelon a020dd0a99 Fixed #21530 -- Prevent AttributeError in default URLconf detection code.
Thanks to @dmyerscoug for the report and original patch
and to @alasdairnicol for the added tests.
2013-12-07 03:21:58 +01:00
Christopher Medrela 7477a4ffde Fixed E125 pep8 warnings 2013-11-28 08:50:11 -05:00
Bouke Haarsma 18185724e6 Fixed #21443 -- Cannot show debug info on PY3's importlib
Thanks productions@zaziork.co.uk for the review.
2013-11-22 20:36:33 +01:00
Aymeric Augustin cb2c3ce154 Merge pull request #1821 from Bouke/tickets/14170
#14170 -- Reset i18n cache when settings changed
2013-11-04 13:50:21 -08:00
Bouke Haarsma 9b95fa7777 Fixed #21322 -- Error message when CSRF cookie is missing
Thanks to Henrik Levkowetz and olau for their reports and initial patches.
2013-11-03 20:05:10 +01:00
Alex Gaynor c347f78cc1 Fixed all E226 violations 2013-11-03 10:08:55 -08:00
Milton Mazzarri cbc7cbbc5b Fixed flake8 E251 violations 2013-11-03 03:22:11 -06:00
Bouke Haarsma d0669843d0 Fixed #14170 -- Reset i18n cache when settings change 2013-11-03 09:36:09 +01:00
Ray Ashman Jr e2ae8b048e Correct flake8 E302 violations 2013-11-02 19:53:29 -04:00
coagulant 3bc0d46a84 Fixed all E261 warnings 2013-11-02 18:20:39 -04:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Bouke Haarsma 6107435386 Fixed #21324 -- Translate CSRF failure view
Thanks to Claude Paroz for the original patch.
2013-11-02 11:22:30 +01:00
Tim Graham 0b1d425a41 Fixed #21347 -- Added missing JS variable declaration.
Thanks szymon.barglowski at gmail.com for the report.
2013-10-30 09:12:27 -04:00
Baptiste Mispelon 3c5cdaf47a Fixed #21345: Don't evaluate callable settings in the debug page.
Thanks to crass for the report.
2013-10-30 07:53:20 +01:00
Alex Gaynor b35ff0d920 Fixed all the E203 violations 2013-10-26 18:27:42 -07:00
Alex Gaynor f2d8027c9a Fixed up some more flake8 violations (this particular violation still has many occurrences in the tests/ dir so it can't be removed from setup.cfg yet) 2013-10-26 10:50:40 -07:00
Bouke Haarsma 0d0f4f020a Fixed #5789 -- Changed LocaleMiddleware session variable to '_language'.
The old 'django_language' variable will still be read from in order
to migrate users. The backwards-compatability shim will be removed in
Django 1.8.

Thanks to jdunck for the report and stugots for the initial patch.
2013-10-22 09:24:42 -04:00
Alasdair Nicol b289fcf1bf Fixed #21288 -- Fixed E126 pep8 warnings 2013-10-21 08:31:30 -04:00
Alasdair Nicol dfb4cb9970 Fixed #21285 -- Fixed E121,E122 pep8 warnings 2013-10-17 20:20:11 -04:00
Bouke Haarsma 2fb5a51fa3 Fixed #18659 -- Deprecated request.REQUEST and MergeDict
Thanks Aymeric Augustin for the suggestion.
2013-10-17 09:42:28 -04:00
Larry O'Neill 83b9bfea44 Fixed #21266 -- Fixed E201,E202 pep8 warnings. 2013-10-14 18:12:00 -04:00
Tim Graham 1dae4ac177 Whitespace cleanup.
* Removed trailing whitespace.
* Added newline to EOF if missing.
* Removed blank lines at EOF.
* Removed some stray tabs.
2013-10-10 16:49:20 -04:00
Tim Graham 2daada800f Fixed #21098 -- Applied sensitive_post_parameters to MultiValueDict
Thanks simonpercivall for the report and bmispelon for the review.
2013-09-18 09:48:36 -04:00
Russell Keith-Magee 9b2dc12b83 Merge pull request #1580 from ianawilson/ticket_16502
Fixed #16502 -- Fixed a TemplateDoesNotExist error that should be an ImproperlyConfigured.

Assistance on the patch from #jambronrose.
2013-09-06 15:31:25 -07:00
Ian Wilson b79df0b358 adds fix for SingleObjectTemplateResponseMixin raising a TemplateDoesNotExist when it should have raised an ImproperlyConfigured. fixes 16502. by @ianawilson, @jambonrose 2013-09-06 16:27:34 -05:00
Ian Wilson 9b7f4aab32 adds fix and test for when a template is not specified at all to render(). fixes #21058. by jambonrose and ianawilson 2013-09-06 15:50:18 -05:00
Aymeric Augustin 6a6428a36f Took advantage of django.utils.six.moves.urllib.*. 2013-09-05 14:39:23 -05:00
Ramiro Morales 6c12cd15e9 Unlocalize line numbers and ids in debug 500 view.
While using USE_L10N, line numbers and IDs were printed as comma (or
locale equivalent) separated values.

Thanks Kronuz for the report and intial patch.

Fixes #20861.
2013-08-12 21:59:27 -03:00
Loic Bistuer f8a6a4eba1 Improved queryset handling and docs for (Single|Multiple)ObjectMixin. 2013-08-09 17:51:58 +07:00
Aymeric Augustin 784377544e Fixed #20822 -- Set content type of default error pages to 'text/html'.
Thanks Jimmy Song for the patch.
2013-08-04 11:04:37 +02:00
Tim Graham 425d076d0c Fixed #18923 -- Corrected usage of sensitive_post_parameters in contrib.auth
Thanks Collin Anderson for the report.
2013-08-02 14:46:17 -04:00
Claude Paroz fdd7a355bf Deprecated django.utils.importlib
This was a shim for pre-Python 2.7 support.
2013-07-29 17:10:22 +02:00
Aymeric Augustin acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
Aymeric Augustin 8b9b8d3bda Removed compatibility code for streaming responses.
This code provided a deprecation path for old-style streaming responses.

Refs #6527, #7581.
2013-06-29 18:49:36 +02:00
Baptiste Mispelon 299983616f Fixed #20644 -- Add ModelFormMixin.fields to the CBV flattened index
Thanks to Tim Graham for the report and review.
2013-06-24 11:59:08 +02:00
Gilberto Gonçalves ef37b23050 Fixed #18872 -- Added prefix to FormMixin
Thanks @ibustama for the initial patch and dragonsnaker for opening the
report.
2013-06-22 12:12:43 +01:00
Aymeric Augustin ffcf24c9ce Removed several unused imports. 2013-06-19 17:18:40 +02:00
Marc Tamlyn b7bd7087e6 Fixed #15273 -- Extend RedirectView to allow reversal by name.
Thanks to @DrMeers for the report and @ludwigkraatz for the initial patch.
2013-06-14 11:59:26 +01:00
Baptiste Darthenay 52f99b78bc Fixed #20585: normalize signature of DeletionMixin.post. 2013-06-11 12:40:06 +02:00
Tim Graham 7902fd74f1 Merge pull request #1027 from intgr/debug_no_exc_message
Clearer explanation when exception has no message
2013-05-30 09:53:07 -07:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Preston Holmes d228c1192e Fixed #19866 -- Added security logger and return 400 for SuspiciousOperation.
SuspiciousOperations have been differentiated into subclasses, and
are now logged to a 'django.security.*' logger. SuspiciousOperations
that reach django.core.handlers.base.BaseHandler will now return a 400
instead of a 500.

Thanks to tiwoc for the report, and Carl Meyer and Donald Stufft
for review.
2013-05-25 16:27:34 -07:00
Krzysztof Jurewicz ee8b810b97 Fixed #20478 – Added support for HTTP PATCH method in generic views. 2013-05-22 14:48:11 +02:00
Mathijs de Bruin 61a8de6f4f Fixed #6412 -- More details if a template file cannot be loaded
Report more details about template files in loader postmortem.
2013-05-21 16:59:40 +02:00
Karol Sikora 3eba8c7f7f Fixed #20234 and #20236 -- SingleObjectMixin fixes
Added object on SingleObjectMixin returned context,
some code clanup.
2013-05-18 21:13:27 +02:00
Shai Berger ff881aef53 Fixed #13958 -- problem reporting exception from \r-line-ended file
Thanks petrvanblokland for reporting and saz for the patch
2013-05-18 19:30:03 +03:00
Olivier Sels 63a9555d57 Fixed #19436 -- Don't log warnings in ensure_csrf_cookie. 2013-05-18 16:17:46 +02:00
Marc Tamlyn ef73a8eefd Merge pull request #1083 from Markush2010/ticket20235
Fixes #20235 - MultipleObjectMixin requires object_list in kwargs
2013-05-18 05:14:28 -07:00
Matthew Somerville 1c921cfac3 Fixed #20235 -- Use self.object_list if object_list not present in get_context_data kwargs.
This is so MultipleObjectMixin can be used in the same way as
SingleObjectMixin.
2013-05-18 14:10:40 +02:00
zyegfryed 5e208d579d Fixed #20433: Extract catalog compilation code from javascript_catalog view. 2013-05-18 13:20:52 +02:00
Luke Plant f026a519ae Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory
 and modelformset_factory, and the generic views `ModelFormMixin`,
 `CreateView` and `UpdateView` which gain a new `fields` attribute.
2013-05-09 16:44:36 +01:00
Florian Apolloner 371dbbe6e0 Ensured that the javascript_catalog view doesn't leak translations. 2013-05-05 15:52:07 +02:00
Marti Raudsepp 172b50b722 Clearer explanation when exception has no message
"No exception supplied" is misleading; actually there is an exception,
but there's no message string.
2013-04-23 21:18:17 +03:00
Matthew Tretter a506b6981b Fixed #18231 -- Made JavaScript i18n not pollute global JS namespace.
Also, use Django templating for the dynamic generated JS code and use
more idiomatic coding techniques.

Thanks Matthew Tretter for the report and the patch.
2013-04-14 17:45:01 -03:00
Aymeric Augustin 3f2befc931 Deprecated django.views.defaults.shortcut. 2013-03-14 20:30:23 +01:00
Aymeric Augustin bc787f6a32 Loaded cycle and firstof from future in built-in templates. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 15:16:45 +01:00
Aymeric Augustin e74e207cce Fixed #17260 -- Added time zone aware aggregation and lookups.
Thanks Carl Meyer for the review.

Squashed commit of the following:

commit 4f290bdb60
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 21:21:30 2013 +0100

    Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

    Thanks Ian Kelly for the suggestion.

commit 01b6366f3c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 13:38:43 2013 +0100

    Made tzname a parameter of datetime_extract/trunc_sql.

    This is required to work around a bug in Oracle.

commit 924a144ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 14:47:44 2013 +0100

    Added support for parameters in SELECT clauses.

commit b4351d2890
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 22:30:22 2013 +0100

    Documented backwards incompatibilities in the two previous commits.

commit 91ef84713c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:42:31 2013 +0100

    Used QuerySet.datetimes for the admin's date_hierarchy.

commit 0d0de288a5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:29:38 2013 +0100

    Used QuerySet.datetimes in date-based generic views.

commit 9c0859ff7c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:25 2013 +0100

    Implemented QuerySet.datetimes on Oracle.

commit 68ab511a4f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:14 2013 +0100

    Implemented QuerySet.datetimes on MySQL.

commit 22d52681d3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:42:29 2013 +0100

    Implemented QuerySet.datetimes on SQLite.

commit f6800fd04c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:03 2013 +0100

    Implemented QuerySet.datetimes on PostgreSQL.

commit 0c829c23f4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:41:08 2013 +0100

    Added datetime-handling infrastructure in the ORM layers.

commit 104d82a777
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 10:05:55 2013 +0100

    Updated null_queries tests to avoid clashing with the __second lookup.

commit c01bbb3235
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 23:07:41 2013 +0100

    Updated tests of .dates().

    Replaced .dates() by .datetimes() for DateTimeFields.
    Replaced dates with datetimes in the expected output for DateFields.

commit 50fb7a5246
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:40:09 2013 +0100

    Updated and added tests for QuerySet.datetimes.

commit a8451a5004
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 22:34:46 2013 +0100

    Documented the new time lookups and updated the date lookups.

commit 29413eab2b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 16:15:49 2013 +0100

    Documented QuerySet.datetimes and updated QuerySet.dates.
2013-02-16 09:19:04 +01:00
Simon Charette a10f390804 Fixed #19044 -- Made `DeletionMixin` interpolate its `success_url`.
Thanks to nxvl and slurms for the initial patch, ptone for the review
and timo for the documentation tweaks.
2013-02-11 02:39:14 -05:00
Simon Charette ec469ade2b Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 2013-02-05 04:16:07 -05:00
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