2020-01-06 23:14:41 +00:00
|
|
|
from django.conf.urls import url
|
2020-01-06 21:58:38 +00:00
|
|
|
from django.contrib import admin
|
2020-01-06 22:36:12 +00:00
|
|
|
from django.urls import include, path
|
|
|
|
from rest_framework import routers
|
2020-06-29 22:44:08 +00:00
|
|
|
from rest_auth.views import LoginView, LogoutView
|
2020-01-06 22:36:12 +00:00
|
|
|
|
|
|
|
from .api import views
|
2020-06-29 22:44:08 +00:00
|
|
|
from . import secrets, settings
|
2020-02-01 23:58:10 +00:00
|
|
|
|
|
|
|
IPN_ROUTE = r'^ipn/{}/'.format(secrets.IPN_RANDOM)
|
2020-05-07 04:18:42 +00:00
|
|
|
ADMIN_ROUTE = '{}/admin/'.format(secrets.ADMIN_RANDOM)
|
2020-01-06 22:36:12 +00:00
|
|
|
|
|
|
|
router = routers.DefaultRouter()
|
2020-01-20 06:01:10 +00:00
|
|
|
router.register(r'door', views.DoorViewSet, basename='door')
|
2020-06-05 01:19:26 +00:00
|
|
|
router.register(r'lockout', views.LockoutViewSet, basename='lockout')
|
2020-01-16 06:17:33 +00:00
|
|
|
router.register(r'cards', views.CardViewSet, basename='card')
|
2020-02-18 07:06:33 +00:00
|
|
|
router.register(r'stats', views.StatsViewSet, basename='stats')
|
2020-01-16 06:17:33 +00:00
|
|
|
router.register(r'search', views.SearchViewSet, basename='search')
|
2020-01-12 08:16:09 +00:00
|
|
|
router.register(r'members', views.MemberViewSet, basename='members')
|
2020-01-10 06:22:38 +00:00
|
|
|
router.register(r'courses', views.CourseViewSet, basename='course')
|
2020-02-25 23:32:28 +00:00
|
|
|
router.register(r'history', views.HistoryViewSet, basename='history')
|
2020-07-12 03:09:24 +00:00
|
|
|
router.register(r'vetting', views.VettingViewSet, basename='vetting')
|
2020-01-10 06:22:38 +00:00
|
|
|
router.register(r'sessions', views.SessionViewSet, basename='session')
|
2020-01-16 06:17:33 +00:00
|
|
|
router.register(r'training', views.TrainingViewSet, basename='training')
|
2020-01-17 07:20:07 +00:00
|
|
|
router.register(r'transactions', views.TransactionViewSet, basename='transaction')
|
2020-04-21 21:12:50 +00:00
|
|
|
router.register(r'charts/membercount', views.MemberCountViewSet, basename='membercount')
|
2020-04-26 04:23:48 +00:00
|
|
|
router.register(r'charts/signupcount', views.SignupCountViewSet, basename='signupcount')
|
2020-06-04 02:28:20 +00:00
|
|
|
router.register(r'charts/spaceactivity', views.SpaceActivityViewSet, basename='spaceactivity')
|
2020-01-08 23:43:59 +00:00
|
|
|
#router.register(r'me', views.FullMemberView, basename='fullmember')
|
|
|
|
#router.register(r'registration', views.RegistrationViewSet, basename='register')
|
2020-01-06 21:58:38 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
2020-01-06 22:36:12 +00:00
|
|
|
path('', include(router.urls)),
|
2020-05-07 04:18:42 +00:00
|
|
|
path(ADMIN_ROUTE, admin.site.urls),
|
2020-06-29 22:44:08 +00:00
|
|
|
url(r'^rest-auth/login/$', LoginView.as_view(), name='rest_login'),
|
2020-09-18 05:03:05 +00:00
|
|
|
url(r'^spaceport-auth/login/$', views.SpaceportAuthView.as_view(), name='spaceport_auth'),
|
2020-06-29 22:44:08 +00:00
|
|
|
url(r'^rest-auth/logout/$', LogoutView.as_view(), name='rest_logout'),
|
2020-06-20 03:48:31 +00:00
|
|
|
url(r'^password/reset/$', views.PasswordResetView.as_view(), name='rest_password_reset'),
|
2020-06-23 20:48:43 +00:00
|
|
|
url(r'^password/reset/confirm/$', views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
|
|
|
|
url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', views.null_view, name='password_reset_confirm'),
|
|
|
|
url(r'^password/change/', views.PasswordChangeView.as_view(), name='rest_password_change'),
|
2020-01-12 08:54:32 +00:00
|
|
|
url(r'^registration/', views.RegistrationView.as_view(), name='rest_name_register'),
|
2020-01-13 01:03:02 +00:00
|
|
|
url(r'^user/', views.UserView.as_view(), name='user'),
|
2020-02-04 08:31:24 +00:00
|
|
|
url(r'^ping/', views.PingView.as_view(), name='ping'),
|
2020-02-17 03:27:41 +00:00
|
|
|
url(r'^paste/', views.PasteView.as_view(), name='paste'),
|
2020-02-16 04:59:02 +00:00
|
|
|
url(r'^backup/', views.BackupView.as_view(), name='backup'),
|
2020-02-01 23:58:10 +00:00
|
|
|
url(IPN_ROUTE, views.IpnView.as_view(), name='ipn'),
|
2020-01-06 21:58:38 +00:00
|
|
|
]
|
2020-06-29 22:44:08 +00:00
|
|
|
|
|
|
|
if settings.DEBUG:
|
|
|
|
urlpatterns += [
|
|
|
|
path('api-auth/', include('rest_framework.urls')),
|
|
|
|
]
|