Skip to main content

Service URLs for tastypie

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tastypie-services-0.2.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file tastypie-services-0.2.2.tar.gz.

File metadata

File hashes

Hashes for tastypie-services-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1bb8a4e741e6bf8623e377ddf360c647bacbdee421c8b31eb10bad0c709859d4
MD5 f27a7c27085ee7157aa2ff56c0caa5ee
BLAKE2b-256 441f9d1562f46aa82d86136a23411b9285ab518486d476fb01ab44e46d1b0dcc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page