Amsterdam Datapunt code and style for Django REST Framework.
Project description
Django REST Framework extensions by Amsterdam Datapunt
Extensions to Django REST Framework by Amsterdam Datapunt. Amsterdam Datapunt provides access to municipal data through, at times, public APIs. This project provides some basic classes and instructions to set the behavior of Django REST Framework API to the standards of Amsterdam Datapunt.
Installation instructions
Given that you have a Django project that generates a REST API using Django REST Framework:
pip install drf_amsterdam
To use the API page styling provided by this package, you need to add datapunt_api to the INSTALLED_APPS list in your Django settings file — before 'rest_framework'. This ensures that the templates and static files included in datapunt_api override those provided by Django REST Framework, so the custom styling is applied correctly.
Building and running the application
If you want to use this package in a local project setup:
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
Note: This package itself is not a standalone application, but is designed to be integrated into an existing Django project.
Running tests
Run the tests in a virtualenv and run the script runtests.py from project root.
requirements: spatialite, sqlite extension
or use docker-compose:
docker compose build
docker compose run --rm tests pytest --cov
Changelog
1.0.0
- Added types
- Tidied up code
- Added tests to reach 100% code coverage
Breaking changes
LinksField
now extendsRelatedField
instead ofHyperLinkedIdentityField
. The reason for this is thatHyperLinkedIdentityField
has to return aHyperLink
object in order to comply with the rules of covariance, which is not what we desire it to return.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file drf_amsterdam-1.0.3.tar.gz
.
File metadata
- Download URL: drf_amsterdam-1.0.3.tar.gz
- Upload date:
- Size: 63.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fe9955ec4ed0f69dec1920954b4bff1f1b060ec40b5fcdc6e9ee0ba0d119c2ad
|
|
MD5 |
6671b45b82bf894c45044e5e61c2528e
|
|
BLAKE2b-256 |
d63b134cea1e17dfd3855ed2002fa7dab406c7d341e9ab532ef8acdb922e887b
|
Provenance
The following attestation bundles were made for drf_amsterdam-1.0.3.tar.gz
:
Publisher:
publish.yaml
on Amsterdam/drf_amsterdam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
drf_amsterdam-1.0.3.tar.gz
-
Subject digest:
fe9955ec4ed0f69dec1920954b4bff1f1b060ec40b5fcdc6e9ee0ba0d119c2ad
- Sigstore transparency entry: 201320367
- Sigstore integration time:
-
Permalink:
Amsterdam/drf_amsterdam@4ffbc793bd80e85149828b3454b9cf60ca57fcb2
-
Branch / Tag:
refs/tags/1.0.3
- Owner: https://github.com/Amsterdam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yaml@4ffbc793bd80e85149828b3454b9cf60ca57fcb2
-
Trigger Event:
release
-
Statement type:
File details
Details for the file drf_amsterdam-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: drf_amsterdam-1.0.3-py3-none-any.whl
- Upload date:
- Size: 65.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5b784c6f7c32042b590a31e39b5d1b0b15c578419492124919bba16e1fa4905f
|
|
MD5 |
4bd4a47344cbb642e19232951588cbd6
|
|
BLAKE2b-256 |
33794c0a188eada155cb16d071715170bf2eba5af27fff603b926ec8a7115b0c
|
Provenance
The following attestation bundles were made for drf_amsterdam-1.0.3-py3-none-any.whl
:
Publisher:
publish.yaml
on Amsterdam/drf_amsterdam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
drf_amsterdam-1.0.3-py3-none-any.whl
-
Subject digest:
5b784c6f7c32042b590a31e39b5d1b0b15c578419492124919bba16e1fa4905f
- Sigstore transparency entry: 201320376
- Sigstore integration time:
-
Permalink:
Amsterdam/drf_amsterdam@4ffbc793bd80e85149828b3454b9cf60ca57fcb2
-
Branch / Tag:
refs/tags/1.0.3
- Owner: https://github.com/Amsterdam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yaml@4ffbc793bd80e85149828b3454b9cf60ca57fcb2
-
Trigger Event:
release
-
Statement type: