Skip to content
A RESTful JSON API for django-fiction-outlines. Part of the broader MACEOutliner project.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github
docs
fiction_outlines_api
tests
.bumpversion.cfg
.coveragerc
.editorconfig
.gitignore
.pyup.yml
AUTHORS.rst
CODE_OF_CONDUCT.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
Pipfile
Pipfile.lock
README.rst
manage.py
pytest.ini
requirements.txt
setup.cfg
setup.py
test_requirements.txt
tox.ini

README.rst

Django Fiction Outlines API

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:

You can’t perform that action at this time.