Skip to content

Commit 2378417

Browse files
authored
Merge pull request #1 from django-tastypie/master
update django-tastypie fork from upstream for django 5.2 compatibility
2 parents fc9db3b + 03c4746 commit 2378417

103 files changed

Lines changed: 1005 additions & 507 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Keep GitHub Actions up to date with GitHub's Dependabot...
2+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
groups:
9+
github-actions:
10+
patterns:
11+
- "*" # Group all Actions updates into a single larger pull request
12+
schedule:
13+
interval: weekly
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test Matrix
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-24.04 # TODO: update to ubuntu-latest when django drops python 3.6
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
django-version: ["4.2", "5.0", "5.1", "5.2"] # Todo: add "dev" back
20+
exclude:
21+
- python-version: "3.8"
22+
django-version: "5.0"
23+
- python-version: "3.8"
24+
django-version: "5.1"
25+
- python-version: "3.8"
26+
django-version: "5.2"
27+
- python-version: "3.9"
28+
django-version: "5.0"
29+
- python-version: "3.9"
30+
django-version: "5.1"
31+
- python-version: "3.9"
32+
django-version: "5.2"
33+
# - python-version: "3.6"
34+
# django-version: "dev"
35+
# - python-version: "3.7"
36+
# django-version: "dev"
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Install OS dependencies
41+
run: |
42+
sudo apt install -y binutils libproj-dev gdal-bin libsqlite3-mod-spatialite
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip wheel virtualenv tox coveralls
51+
- name: Erase cached coverage
52+
run: |
53+
coverage erase
54+
- name: Flake8
55+
run: |
56+
tox -e py${{matrix.python-version}}-flake8
57+
- name: Docs
58+
run: |
59+
tox -e py${{matrix.python-version}}-docs
60+
- name: Test with Tox
61+
run: |
62+
tox -e py${{matrix.python-version}}-dj${{matrix.django-version}}
63+
- name: Upload coverage data to coveralls.io
64+
run: coveralls --service=github
65+
continue-on-error: true
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+

.readthedocs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "2"
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.11"
7+
8+
python:
9+
install:
10+
- requirements: docs/requirements.txt

.travis.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ Contributors:
103103
* Danny Roberts (dannyroberts) for very small change addressing noisy RemovedInDjango20Warning warnings
104104
* Sam Thompson (georgedorn) for ongoing maintenance and release management.
105105
* Matt Briançon (mattbriancon) for various patches
106+
* Blayze Wilhelm (blayzen-w) for a small patch that fixed an issue with saving (PR #1628)
107+
* Ryan Young (ryanneilyoung) for removing python 2 code
108+
* Chander Ganesan (chander) for minor patches, added support for django 4.1 and 5.0
106109

107110

108111
Thanks to Tav for providing validate_jsonp.py, placed in public domain.

BACKWARDS-INCOMPATIBLE.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
Master (v0.9.16)
2-
================
1+
v0.15.0
2+
=======
3+
4+
[2024-10-15] 2444fce - PATCH requests no longer save entire objects, instead only updating fields specified in the payload. This is correct behavior and an unusual edge case, but has been broken for more than a decade so existing workarounds may break as a result.
5+
6+
7+
v0.9.16
8+
======
39

410
[2012-12-11] abc0bef - Changed response code of PUT with always_return_data=True from 202 to 200
511

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ django-tastypie
66
:target: https://django-tastypie.readthedocs.io/
77
:alt: Docs
88

9-
.. image:: https://travis-ci.org/django-tastypie/django-tastypie.svg?branch=master
10-
:target: https://travis-ci.org/django-tastypie/django-tastypie
9+
.. image:: https://github.com/django-tastypie/django-tastypie/actions/workflows/python-package.yml/badge.svg
10+
:target: https://github.com/django-tastypie/django-tastypie/actions
1111
:alt: CI
1212

1313
.. image:: https://coveralls.io/repos/django-tastypie/django-tastypie/badge.svg?service=github
@@ -24,7 +24,7 @@ django-tastypie
2424

2525
Creating delicious APIs for Django apps since 2010.
2626

27-
Currently in beta (v0.14.2) but being used actively in production on several
27+
Currently in beta but being used actively in production on several
2828
sites.
2929

3030

@@ -34,8 +34,8 @@ Requirements
3434
Core
3535
----
3636

37-
* Python 2.7+ or Python 3.4+
38-
* Django - 1.11 (LTS), 2.0 (LTS) or 2.1 - the last two LTS and the last incremental release are supported.
37+
* Python 3.8+ (Whatever is supported by your version of Django)
38+
* Django 4.2 (LTS releases) or Django 4.0+ (intermediate releases, including 5.0 and 5.1)
3939
* dateutil (http://labix.org/python-dateutil) >= 2.1
4040

4141
Format Support
@@ -71,7 +71,7 @@ A basic example looks like:
7171
7272
# urls.py
7373
# =======
74-
from django.conf.urls import url, include
74+
from django.urls.conf import re_path, include
7575
from tastypie.api import Api
7676
from myapp.api import EntryResource
7777
@@ -80,7 +80,7 @@ A basic example looks like:
8080
8181
urlpatterns = [
8282
# The normal jazz here then...
83-
url(r'^api/', include(v1_api.urls)),
83+
re_path(r'^api/', include(v1_api.urls)),
8484
]
8585
8686
That gets you a fully working, read-write API for the ``Entry`` model that

SECURITY.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
===============
2+
django-tastypie
3+
===============
4+
5+
Security Policy
6+
===============
7+
8+
Tastypie is committed to providing a flexible and secure API, and was designed
9+
with many security features and options in mind. Due to the complex nature of
10+
APIs and the constant discovery of new attack vectors and vulnerabilities,
11+
no software is immune to security holes. We rely on our community to report
12+
and help us investigate security issues.
13+
14+
If you come across a security hole **please do not open a Github issue**.
15+
Instead, **drop us an email** at ``tastypie-security@googlegroups.com``
16+
17+
We'll then work together to investigate and resolve the problem so we can
18+
announce a solution along with the vulnerability.

docs/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Quick Start
1717
A sample api definition might look something like (usually located in a
1818
URLconf)::
1919

20-
from django.conf.urls import url, include
20+
from django.urls.conf import re_path, include
2121
from tastypie.api import Api
2222
from myapp.api.resources import UserResource, EntryResource
2323

@@ -27,7 +27,7 @@ URLconf)::
2727

2828
# Standard bits...
2929
urlpatterns = [
30-
url(r'^api/', include(v1_api.urls)),
30+
re_path(r'^api/', include(v1_api.urls)),
3131
]
3232

3333
For namespaced urls see :ref:`namespaces`

docs/authorization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The permissions required using ``DjangoAuthorization`` follow Django Admin's imp
8080
+---------------------------------+------------------+-----------------------------------------------+----------------------+
8181
| ``DELETE <resource>/`` | delete\_list | ``delete`` | ``read_list`` |
8282
+---------------------------------+------------------+-----------------------------------------------+----------------------+
83-
| ``DELETE <resource>/`` | delete\_detail | ``delete`` | ``read_detail`` |
83+
| ``DELETE <resource>/<id>`` | delete\_detail | ``delete`` | ``read_detail`` |
8484
+---------------------------------+------------------+-----------------------------------------------+----------------------+
8585

8686
(*) The permission check for ``create_detail`` is implemented in ``DjangoAuthorization``, however ModelResource does not provide an implementation and raises HttpNotImplemented.

0 commit comments

Comments
 (0)