Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

mangal-interactions/mangal-api-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Timothée Poisot
Oct 17, 2015
4344d66 · Oct 17, 2015

History

29 Commits
Jan 16, 2014
Jan 16, 2014
May 1, 2014
Jan 16, 2014
Sep 19, 2014
Oct 17, 2015
Oct 17, 2015
Sep 19, 2014

Repository files navigation

mangal-api

This repository contains the files necessary to add tha mangal API to your django project. Up-to-date versions of django and django-tastypie are required.

Authorisation classes

The application adds two custom authorization classes: MangalAuthorization and UserAuthorization, respectively to access the objects stored in the databases, and to interact with the database users.

Installation

In the urls.py file of your application, add:

from tastypie.api import Api
from api.resources import *

v1_api = Api(api_name='v1')
v1_api.register(UserResource())
v1_api.register(TaxaResource())
v1_api.register(PopulationResource())
v1_api.register(InteractionResource())
v1_api.register(NetworkResource())
v1_api.register(DatasetResource())
v1_api.register(RefResource())
v1_api.register(TraitResource())
v1_api.register(EnvironmentResource())
v1_api.register(ItemResource())

Then, in the urlpatterns variable, add

    url(r'^api/', include(v1_api.urls)),

And don't forget to add api in the list of INSTALLED_APPS.

About

The mangal API (as a Django/Tastypie app)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages