zulip/zilencer/urls.py

38 lines
1.3 KiB
Python
Raw Normal View History

from typing import Any
2017-11-16 00:55:49 +01:00
from django.conf.urls import include, url
2016-10-27 15:05:55 +02:00
import zilencer.views
2017-11-16 00:55:49 +01:00
from zerver.lib.rest import rest_dispatch
i18n_urlpatterns = [
2018-03-31 04:13:44 +02:00
url(r'^billing/$', zilencer.views.billing_home, name='zilencer.views.billing_home'),
url(r'^upgrade/$', zilencer.views.initial_upgrade, name='zilencer.views.initial_upgrade'),
] # type: Any
# Zilencer views following the REST API style
v1_api_and_json_patterns = [
url('^remotes/push/register$', rest_dispatch,
{'POST': 'zilencer.views.register_remote_push_device'}),
url('^remotes/push/unregister$', rest_dispatch,
{'POST': 'zilencer.views.unregister_remote_push_device'}),
url('^remotes/push/notify$', rest_dispatch,
{'POST': 'zilencer.views.remote_server_notify_push'}),
# Push signup doesn't use the REST API, since there's no auth.
url('^remotes/server/register$', zilencer.views.register_remote_server),
2018-08-31 20:09:36 +02:00
url(r'^billing/downgrade$', rest_dispatch,
{'POST': 'zilencer.views.downgrade'}),
url(r'billing/sources/change', rest_dispatch,
{'POST': 'zilencer.views.replace_payment_source'}),
]
# Make a copy of i18n_urlpatterns so that they appear without prefix for English
urlpatterns = list(i18n_urlpatterns)
urlpatterns += [
url(r'^api/v1/', include(v1_api_and_json_patterns)),
url(r'^json/', include(v1_api_and_json_patterns)),
]