A simple API end point that we’ve found useful for our Tastypie API services at Mozilla.
Installation
Install using pip:
pip install tastypie-services
Note: version 2 renamed the lib from services to tastypie_services.
Configuration
Add to your urls:
from tastypie_services.urls import services
urlpatterns = patterns('',
...
url(r'^', include(services.urls)),
)
If you want to allow settings access, set:
CLEANSED_SETTINGS_ACCESS = False
The actual server status is very specific to your server, so you need to create a base class overriding the one in services. The tell the library where the object is. For example:
SERVICES_STATUS_MODULE = 'lib.services.resources'
Then in lib.tastypie_services.resources:
from tastypie_services.services import StatusObject as Base
class StatusObject(Base):
def test_cache(self):
cache.set('status', 'works')
if cache.get('status') == 'works':
self.cache = True
See solitude for an example of this.
Metadata
Release files for tastypie-services 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tastypie-services-0.2.2.tar.gz | 3.9 kB | Without provenance | Details for tastypie-services-0.2.2.tar.gz |
Release files / tastypie-services-0.2.2.tar.gz
| Download URL | tastypie-services-0.2.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bb8a4e741e6bf8623e377ddf360c647bacbdee421c8b31eb10bad0c709859d4
|
|
BLAKE2b-256 checksum How to use checksums |
441f9d1562f46aa82d86136a23411b9285ab518486d476fb01ab44e46d1b0dcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tastypie-services 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.