urls.py 696 B

1234567891011121314151617181920212223242526
  1. from django.urls import path, include
  2. from rest_framework_nested import routers
  3. from .views import (
  4. SubscriptionViewSet,
  5. ProductViewSet,
  6. CreateStripeSubscriptionCheckout,
  7. StripeBillingPortal,
  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. ]