api.py 1001 B

1234567891011121314151617181920212223242526
  1. from django.conf.urls import url
  2. from misago.core.apirouter import MisagoApiRouter
  3. from ..api import auth, captcha
  4. from ..api.ranks import RanksViewSet
  5. from ..api.usernamechanges import UsernameChangesViewSet
  6. from ..api.users import UserViewSet
  7. urlpatterns = [
  8. url(r'^auth/$', auth.gateway, name='auth'),
  9. url(r'^auth/criteria/$', auth.get_criteria, name='auth-criteria'),
  10. url(r'^auth/send-activation/$', auth.send_activation, name='send-activation'),
  11. url(r'^auth/send-password-form/$', auth.send_password_form, name='send-password-form'),
  12. url(r'^auth/change-password/(?P<pk>\d+)/(?P<token>[a-zA-Z0-9]+)/$', auth.change_forgotten_password, name='change-forgotten-password'),
  13. url(r'^captcha-question/$', captcha.question, name='captcha-question'),
  14. ]
  15. router = MisagoApiRouter()
  16. router.register(r'ranks', RanksViewSet)
  17. router.register(r'users', UserViewSet)
  18. router.register(r'username-changes', UsernameChangesViewSet, base_name='usernamechange')
  19. urlpatterns += router.urls