Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

About

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

Resources

License

Packages

No packages published

Languages