* update Django for APIs book cover
* remove retired course from Treehouse
* add DCUS2018 talk, update links from wsvincent.com tutorials to learndjango.com
Making explicit the http GET method of the httpie calls.
For some reason it is sending a POST instead of a GET request as it should be described here:
https://httpie.io/docs/cli/optional-get-and-post
Note:
I was following the docs and testing it within the Git Bash windows console app for making the requests and debugging the DRF projenct in pycharm.
* Add support for Python 3.13
* Fix extracting tox env with -dev Python versions
* Fix view description inspection in Python 3.13
Python 3.13 introduced docstrings for None: https://github.com/python/cpython/pull/117813
In Python 3.12, this is an empty string:
```
➜ python3.12
Python 3.12.6 (main, Sep 10 2024, 19:06:17) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = None
>>> d.__doc__
>>>
```
In Python 3.13, it's no longer empty:
```
➜ python3.13
Python 3.13.0rc2+ (heads/3.13:660baa1, Sep 10 2024, 18:57:50) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = None
>>> d.__doc__
'The type of the None singleton.'
>>>
```
Adding a check in the inspector that get the view description out the view function docstring to catch this edge case.
And remove note regarding only working with Django 2.x or above, as it's been a while the feature is present, and DRF only supports Django 4.2+.
I was looking for this but couldn't see it in the docs, having it in a separate section would make it easier to find and link to.
Moreover, as it stands, one might think that the feature is limited to SimpleRouter, while it's also available for DefaultRouter.
* Add official support for Django 5.1
Following the supported Python versions:
https://docs.djangoproject.com/en/stable/faq/install/
* Add tests to cover compat with Django's 5.1 LoginRequiredMiddleware
* First pass to create DRF's LoginRequiredMiddleware
* Attempt to fix the tests
* Revert custom middleware implementation
* Disable LoginRequiredMiddleware on DRF views
* Document how to integrate DRF with LoginRequiredMiddleware
* Move login required tests under a separate test case
* Revert redundant change
* Disable LoginRequiredMiddleware on ViewSets
* Add some integrations tests to cover various view types
* Use Decimal for min/max values of DecimalField in tests
* Update docs to mention that min/max values should be Decimal objects
* Accept integer values for DecimalField min and max values
* Update expected error messages in tests
* Update expected warning message in tests
The header input is now properly escaped before splitting and joining with <br> tags. This prevents potential XSS attacks if the header contains unsanitized user input.
According to docs:
https://docs.python.org/3/library/unittest.html#unittest.TestCase.addClassCleanup
> Add a function to be called after tearDownClass() to cleanup resources
used during the test class. Functions will be called in reverse order to
the order they are added (LIFO).
This was revealed with recent change in pytest (`8.2.0`):
> pytest-dev/pytest#11728: For unittest-based tests, exceptions during
class cleanup (as raised by functions registered with
TestCase.addClassCleanup) are now reported instead of silently failing.
`check_urlpatterns` is called before `cleanup_url_patterns` and fails
(problem was hidden by `pytest < 8.2.0`).
`doClassCleanups` can be used instead to check after-cleanup state:
https://docs.python.org/3/library/unittest.html#unittest.TestCase.doClassCleanups
> This method is called unconditionally after tearDownClass(), or after
setUpClass() if setUpClass() raises an exception.
It is responsible for calling all the cleanup functions added by
addClassCleanup(). If you need cleanup functions to be called prior to
tearDownClass() then you can call doClassCleanups() yourself.
Fixes: https://github.com/encode/django-rest-framework/issues/9399
Signed-off-by: Stanislav Levin <slev@altlinux.org>