urls.py 697 B

123456789101112131415161718192021222324252627
  1. from django.urls import include, path
  2. from rest_framework_nested import routers
  3. from .views import (
  4. CreateStripeSubscriptionCheckout,
  5. ProductViewSet,
  6. StripeBillingPortal,
  7. SubscriptionViewSet,
  8. )
  9. router = routers.SimpleRouter()
  10. router.register(r"subscriptions", SubscriptionViewSet)
  11. router.register(r"products", ProductViewSet)
  12. urlpatterns = [
  13. path("", include(router.urls)),
  14. path(
  15. "create-stripe-subscription-checkout/",
  16. CreateStripeSubscriptionCheckout.as_view(),
  17. name="create-stripe-subscription-checkout",
  18. ),
  19. path(
  20. "create-billing-portal/",
  21. StripeBillingPortal.as_view(),
  22. name="create-billing-portal",
  23. ),
  24. ]