Refactor rest_api app and the method end points are registered. All apps API URL endpoints are now registered under the 'rest_api' namespace.
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import apps
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common import menu_tools
|
||||
from common import MayanAppConfig, menu_tools
|
||||
|
||||
from .classes import APIEndPoint
|
||||
from .links import link_api, link_api_documentation
|
||||
|
||||
|
||||
class RESTAPIApp(apps.AppConfig):
|
||||
class RESTAPIApp(MayanAppConfig):
|
||||
app_url = 'api'
|
||||
name = 'rest_api'
|
||||
verbose_name = _('REST API')
|
||||
|
||||
def ready(self):
|
||||
APIEndPoint('rest_api')
|
||||
super(RESTAPIApp, self).ready()
|
||||
|
||||
APIEndPoint(app=self, version_string='1')
|
||||
|
||||
menu_tools.bind_links(links=(link_api, link_api_documentation))
|
||||
|
||||
Reference in New Issue
Block a user