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 must add it to the Django settings file in INSTALLED_APPS, ahead of 'rest_framework' so that the templates and static files included in drf_amsterdam override those included with Django REST Framework.
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.1.tar.gz
.
File metadata
- Download URL: drf_amsterdam-1.0.1.tar.gz
- Upload date:
- Size: 62.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92c491767e56e783bf176da57c015f745c8016d6667da32b16c6a7705675f70 |
|
MD5 | 346da20e133307b7e986a8f6f3da34b4 |
|
BLAKE2b-256 | 602043661651600d298e66f6c664e76ab536517fa8048b818d0664a330009234 |
File details
Details for the file drf_amsterdam-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: drf_amsterdam-1.0.1-py3-none-any.whl
- Upload date:
- Size: 64.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b9586ee45d04c757828c4c55093164aa84113fc82a8289559370ff56027b609 |
|
MD5 | 55a99e4c0512583f42f1eb4a2543ff65 |
|
BLAKE2b-256 | 8b5659f8934e6bcfeb2a09efaa2e648d1a71bf52605e9e9a76c90cdc6df6f144 |