urlpatterns = [ url(r'^$', newsletter_views.home, name='home'), url(r'^contact/$', newsletter_views.contact, name='contact'), url(r'^about/$', main_views.about, name='about'), url(r'^cart/', include('carts.urls')), url(r'^checkout/', include('carts.urls_checkout')), url(r'^orders/', include('orders.urls')), url(r'^products/', include('products.urls')), url(r'^categories/', include('products.urls_categories')), url(r'^admin/', admin.site.urls), url(r'^accounts/', include('registration.backends.default.urls')), ] urlpatterns += [ url(r'^api/$', APIHomeView.as_view(), name='home_api'), url(r'^api/cart/$', CartAPIView.as_view(), name='cart_api'), url(r'^api/checkout/$', CheckoutAPIView.as_view(), name='checkout_api'), url(r'^api/auth/token/$', obtain_jwt_token), url(r'^api/auth/token/refresh/$', refresh_jwt_token), url(r'^api/user/checkout/$', UserCheckoutAPI.as_view(), name='user_checkout_api'), url(r'^api/user/address/$', UserAddressListAPIView.as_view(), name='user_address_list_api'), url(r'^api/user/address/create/$', UserAddressCreateAPIView.as_view(), name='user_address_create_api'), url(r'^api/products/$', ProductListAPIView.as_view(), name='products_api'), url(r'^api/products/(?P<pk>\d+)/$', ProductRetrieveAPIView.as_view(), name='product_detail_api'), url(r'^api/categories/$', CategoryListAPIView.as_view(), name='categories_api'), url(r'^api/categories/(?P<pk>\d+)/$', CategoryRetrieveAPIView.as_view(), name='category_detail_api'), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
url(r'^checkout/$', CheckoutView.as_view(), name='checkout'), url(r'^checkout/address/$', AddressSelectFormView.as_view(), name='order_address'), url(r'^checkout/address/add/$', UserAddressCreateView.as_view(), name='user_address_create'), url(r'^checkout/final/$', CheckoutFinalView.as_view(), name='checkout_final'), ] #API Patterns urlpatterns += [ url(r'^api/$', APIHomeView.as_view(), name='home_api'), url(r'^api/cart/$', CartAPIView.as_view(), name='cart_api'), url(r'^api/checkout/$', CheckoutAPIView.as_view(), name='checkout_api'), url(r'^api/checkout/finalize/$', CheckoutFinalizeAPIView.as_view(), name='checkout_finalize_api'), url(r'^api/auth/token/$', 'rest_framework_jwt.views.obtain_jwt_token', name='auth_login_api'), url(r'^api/auth/token/refresh/$', 'rest_framework_jwt.views.refresh_jwt_token', name='refresh_token_api'), url(r'^api/user/address/$', UserAddressListAPIView.as_view(), name='user_address_list_api'), url(r'^api/user/address/create/$', UserAddressCreateAPIView.as_view(),
urlpatterns = [ path('admin/', admin.site.urls), path('api/',APIHomeView.as_view(), name='home'), # path('api/accounts/', include('rest_registration.api.urls')), path('api/auth/register/', RegisterAPIView.as_view(), name='registration'), path('api/auth/verify-email/', VerifyEmailAPIView.as_view(), name='verify_email'), # path('api/auth/login/', LoginAPIView.as_view(), name='auth_login'), path('api/auth/login/', obtain_jwt_token, name='auth_login'), path('api/auth/token/refresh/', refresh_jwt_token, name='refresh_token'), path('api/token/verify/', verify_jwt_token, name='verify_token'), path('api/auth/logout/', LogoutAPIView.as_view(), name='auth_logout'), path('api/categories/', CategoryListAPIView.as_view(), name='categories_list'), path('api/categories/<int:pk>/', CategoryRetrieveAPIView.as_view(), name='category_detail'), path('api/products/', ProductListAPIView.as_view(), name='product_list'), path('api/products/<int:pk>/', ProductRetrieveAPIView.as_view(), name='product_detail'), path('api/orders/', OrderListAPIView.as_view(), name='orders'), path('api/orders/<int:pk>/', OrderRetrieveAPIView.as_view(), name='order_detail'), path('api/user/address/', UserAddressListAPIView.as_view(), name='user_address_list'), path('api/user/address/create/', UserAddressCreateAPIView.as_view(), name='user_address_create'), path('api/user/checkout/', UserCheckoutAPI.as_view(), name='user_checkout'), path('api/cart/', CartAPIView.as_view(), name='cart'), path('api/checkout/', CheckoutAPIView.as_view(), name='checkout'), path('api/checkout/finalize/', CheckoutFinalizeAPIView.as_view(), name='checkout_finalize'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)