Skip to main content

A RESTful JSON API for django-fiction-outlines. Part of the broader maceoutliner project.

Project description

https://badge.fury.io/py/django-fiction-outlines-api.svg https://circleci.com/gh/maceoutliner/django-fiction-outlines-api.svg?style=svg https://coveralls.io/repos/github/maceoutliner/django-fiction-outlines-api/badge.svg?branch=master Documenatation Status

A RESTful JSON API for django-fiction-outlines.

Documentation

The full documentation is at https://django-fiction-outlines-api.readthedocs.io. The source code can be found at https://github.com/maceoutliner/django-fiction-outlines-api/.

Quickstart

Install Django Fiction Outlines API:

pip install django-fiction-outlines-api

Add it and dependencies to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    '
    'rest_framework',
    'taggit',
    'rules.apps.AutodiscoverRulesConfig',
    'rest_framework_rules',
    'fiction_outlines',
    'fiction_outlines_api',
    ...
)

If you have not already, add rules to you AUTHENTICATION_BACKENDS.

AUTHENTICATION_BACKENDS = (
    'rules.permissions.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
)

Unless you like to live dangerously, it is STRONGLY recommend you configure whichever database you use for outlines to have ATOMIC_REQUESTS to True.

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "outlines",
        "ATOMIC_REQUESTS": True,
    }}

Add Django Fiction Outlines API’s URL patterns:

from fiction_outlines_api import urls as fiction_outlines_api_urls


urlpatterns = [
    ...
    url(r'^', include(fiction_outlines_api_urls)),
    ...
]

If you haven’t already installed fiction_outlines you should run python manage.py migrate now.

Features

NOTE: As with fiction_outlines, this app makes use of the excellent object permissions library django-rules.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r test_requirements.txt
(myenv) $ pytest
(myenv) $ flake8 setup.py fiction_outlines_api tests

Credits

Tools used in rendering this package:

History

0.1.0 (2018-04-07)

  • First release on PyPI.

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

django-fiction-outlines-api-0.1.0.tar.gz (18.2 kB view hashes)

Uploaded Source

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