api.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. from django.conf.urls import url
  2. from ...core.apirouter import MisagoApiRouter
  3. from ..api import auth, captcha, mention
  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(
  12. r"^auth/send-password-form/$",
  13. auth.send_password_form,
  14. name="send-password-form",
  15. ),
  16. url(
  17. r"^auth/change-password/(?P<pk>\d+)/(?P<token>[a-zA-Z0-9]+)/$",
  18. auth.change_forgotten_password,
  19. name="change-forgotten-password",
  20. ),
  21. url(r"^captcha-question/$", captcha.question, name="captcha-question"),
  22. url(r"^mention/$", mention.mention_suggestions, name="mention-suggestions"),
  23. ]
  24. router = MisagoApiRouter()
  25. router.register(r"ranks", RanksViewSet)
  26. router.register(r"users", UserViewSet)
  27. router.register(r"username-changes", UsernameChangesViewSet, basename="usernamechange")
  28. urlpatterns += router.urls