50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
from django.urls import re_path
|
|
|
|
from .views import info, badger, authenticate
|
|
|
|
app_name = "bid_api"
|
|
urlpatterns = [
|
|
re_path(r"^user$", info.user_info, name="user"),
|
|
re_path(r"^me$", info.user_info),
|
|
re_path(r"^user/(?P<user_id>\d+)$", info.UserInfoView.as_view(), name="user-info-by-id"),
|
|
re_path(
|
|
r"^user/(?P<user_id>\d+)/avatar$",
|
|
info.UserAvatarView.as_view(),
|
|
name="user-avatar",
|
|
),
|
|
re_path(
|
|
r"^badges/(?P<user_id>\d+)$",
|
|
info.UserBadgeView.as_view(),
|
|
name="user-badges-by-id",
|
|
),
|
|
re_path(
|
|
r"^badges/(?P<user_id>\d+)/html$",
|
|
info.BadgesHTMLView.as_view(),
|
|
name="user-badges-html",
|
|
),
|
|
re_path(
|
|
r"^badges/(?P<user_id>\d+)/html/(?P<size>[a-z])$",
|
|
info.BadgesHTMLView.as_view(),
|
|
name="user-badges-html",
|
|
),
|
|
re_path(r"^stats$", info.StatsView.as_view(), name="stats"),
|
|
re_path(
|
|
r"^badger/grant/(?P<badge>[^/]+)/(?P<email_or_uid>[^/]+)$",
|
|
badger.BadgerView.as_view(action="grant"),
|
|
name="badger_grant",
|
|
),
|
|
re_path(
|
|
r"^badger/revoke/(?P<badge>[^/]+)/(?P<email_or_uid>[^/]+)$",
|
|
badger.BadgerView.as_view(action="revoke"),
|
|
name="badger_revoke",
|
|
),
|
|
re_path(
|
|
r"^authenticate/?$",
|
|
authenticate.AuthenticateView.as_view(),
|
|
name="authenticate",
|
|
),
|
|
]
|
|
|
|
# noinspection PyUnresolvedReferences
|
|
from . import signals as _ # noqa: F401, E402
|