Repository navigation
APIv1: disable by default - #3608
Conversation
madchap
left a comment
There was a problem hiding this comment.
Nicely done! I'd still love to see some of my comments addressed, yet this is dealing nicely with the deprecation we've had in the documentation for some time now.
|
Please note that this was meant to be a quick sunday afternoon PR. Turns out that it's not so easy to override requests in tastypie because the framework itself is wrapping it's view method in a Same for those sanitize/escape things in there. They are used by the code from tastypie so wouldn't want to remove them and then see someone posting something on H1 :-D |
* APIv1: Disable by default
Now that APIv1 is deprecated, it might be best to disable it by default. It can be enabled by setting
DD_LEGACY_API_V1_ENABLEenvironment variable toTrue. Or by settingLEGACY_API_V1_ENABLEtoTruein alocal_settings.pyfile.By default all apiv1 request return a 400 message with an error:
When APIv1 is enabled again, it will work, but will also return some warnings:
With unit test! And existing unit tests still work using a override_settings decorator.