This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

The Flask extension for py-jsonapi

Project Description

This extension connects your Flask application with py-jsonapi.

Installation

You can install this extension via PyPi:

$ pip3 install py-jsonapi-flask

How to

You can use py-jsonapi-flask like every other Flask extension:

from flask import Flask
from jsonapi_flask.api import API

app = Flask(__name__)
api = API("/api", flask_app=app)

You can also register the extension later via init_app():

api.init_app(app)

In these examples, the API will take control over all urls starting with /api/.

current_api

You can access the current API via the extensions dictionary of the flask application:

app.extensions["jsonapi"]

or you use the global variable current_api:

from jsonapi_flask.api import current_api

The API instance is also added to the jinja environment:

<p>
    You can download your profile
    <a href="{{ jsonapi.resource_uri(current_user) }}">
        here
    </a>
</p>

current_request

You can also access the current py-jsonapi request object:

from jsonapi_flask.api import current_request

The request is also added to the jinja environment under the name jsonapi_request.

License

This library is licensed under the MIT License.

Contributions and questions

Contributions are always welcome. If you have a question, don’t hesitate to open a new issue.

Version numbers

We will use semantic version numbers, starting with the first release.

Release History

Release History

This version
History Node

1.0.3b0

History Node

1.0.2b0

History Node

1.0.1b0

History Node

1.0.0b0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
py-jsonapi-flask-1.0.3b0.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Nov 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting