Exemplo n.º 1
0
# Importando Apps de Aluno, Curso e Perfil
from aluno import views as aluno_views
from curso import views as curso_views
from perfil import views as perfil_views

###############################################
# Importando Apps de Aluno, Curso, Index & Perfil
###############################################
from aluno import views as aluno_views
from curso import views as curso_views
from perfil import views as perfil_views

###############################################
# Criando rotas para a API
###############################################
mongo_router = mongo_routers.SimpleRouter()
routerApi = routers.DefaultRouter()

# Informando as rotas da API - Aluno
routerApi.register(r'aluno', aluno_views.AlunoApiView)
mongo_router.register(r'aluno',aluno_views.AlunoMongoView, 'Aluno')
mongo_router.register(r'matricula',curso_views.MatriculaMongoView, 'Aluno')

# Informando as rotas da API - Curso
routerApi.register(r'curso',curso_views.CursoApiView)
routerApi.register(r'matricula',curso_views.MatriculaApiView)

# Informando as rotas da API - Perfil
routerApi.register(r'perfil',perfil_views.PerfilApiView)
routerApi.register(r'perfil_aluno',perfil_views.PerfilApiAlunoView)
routerApi.register(r'perfil_curso',perfil_views.PerfilApiCursoView)
Exemplo n.º 2
0
# coding=utf-8
from django.conf.urls import url, include
from django_angular.views import IndexView
from rest_framework_mongoengine import routers
from mongo_auth import urls as mongo_auth_urls
from authentication.views import UsersView
from posts.views import PostsView


router = routers.SimpleRouter()
router.register(r'users', UsersView, base_name='post')
router.register(r'posts', PostsView, base_name='post')

urlpatterns = [
    url(r'^api/v1/', include(router.urls)),
    url(r'^api/v1/auth/', include(mongo_auth_urls)),
    url('^.*$', IndexView.as_view(), name='index'),
]