Package: annotator_store
annotator_storeis aDjangoapplication meant for use within a Django project as anannotator.js2.x annotation
store backend, and implements theAnnotator Storage API.annotator_storewas originally develop as a component ofReadux.LicenseThis software is distributed under the Apache 2.0 License.InstallationUse pip to install:pip installYou can also install from GitHub.  Use branch or tag name, e.g.@developor@1.0, to install a specific tagged release or branch:pip install git+https://github.com/Princeton-CDH/django-annotator-store.git@develop#egg=annotator_storeConfigurationAddannotator_storeto installed applications and make sure that other
required components are enabled:INSTALLED_APPS = (
    ...
  'django.contrib.auth',
  'django.contrib.admin',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.sites',
  'annotator_store',
    ...
)Include the annotation storage API urls at the desired base url with the
namespace:from annotator_store import views as annotator_views

urlpatterns = [
    # annotations
    url(r'^annotations/api/', include('annotator_store.urls', namespace='annotation-api')),
    # annotatorjs doesn't handle trailing slash in api prefix url
    url(r'^annotations/api', annotator_views.AnnotationIndex.as_view(), name='annotation-api-prefix'),
]Run migrations to create annotation database tables:python manage.py migrateNoteIf you want per-object permissions on individual annotations (rather than
the standard django type-based permissions), you must also installdjango-guardianand includeguardianin yourINSTALLED_APPS.  Per-object permissions must be turned on in Django
settings by settingANNOTATION_OBJECT_PERMISSIONSto True.Custom Annotation ModelThis module is designed to allow the use of a custom Annotation model, in order
to add functionality or relationships to other models within an application.
To take advantage of this feature, you should extend the abstract modelannotator_store.models.BaseAnnotationand configure your model in
Django setings, e.g.:ANNOTATOR_ANNOTATION_MODEL = 'myapp.LocalAnnotation'If you want per-object permissions on your annotation model, you should
extendannotator_store.models.AnnotationWithPermissionsrather than
the base annotation class.NotePer-object permissions require that apermissions pluginbe
included when you initialize your annotator.js Annotator object.
That code is currently available as a plugin in theReadux codebaseDevelopment instructionsThis git repository usesgit flowbranching conventions.Initial setup and installation:recommended: create and activate a python virtualenv:virtualenv annotator-store
source annotator-store/bin/activatepip install the package with its python dependencies:pip install -e .Unit TestingUnit tests are run withpy.testbut use
Django test classes for convenience and compatibility with django test suites.
Running the tests requires a minimal settings file for Django required
configurations.Copy sample test settings and add aSECRET_KEY:cp ci/testsettings.py testsettings.pyTo run the tests, either use the configured setup.py test command:python setup.py testOr install test requirements and use py.test directly:pip install -e '.[test]'
py.testSphinx DocumentationTo work with the sphinx documentation, installsphinxdirectly via pip
or via:pip install -e '.[docs]'Documentation can be built in thedocsdirectory using:make html