# Path: cart/views.py
# def cartDetailView(request):
#     return render_to_response('cartDetail.html', dict(cart=Cart(request)))
# 
# @csrf_exempt
# def removeFromCartView(request, product_id):
# 
#     CartManagement.removeFromCart(request, product_id)
# 
#     return redirect('/cart/cart_detail')


from cart.views import cartDetailView, removeFromCartView
from django.conf.urls import url
from django.contrib.auth.decorators import login_required


urlpatterns = [
    url(r'^cart_detail/', login_required(cartDetailView),
        name='cartDetailView'),
    url(r'^(?P<product_id>[0-9]+)/remove_from_cart/$',

# Path: cart/views.py
# def cartDetailView(request):
#     return render_to_response('cartDetail.html', dict(cart=Cart(request)))
# 
# @csrf_exempt
# def removeFromCartView(request, product_id):
# 
#     CartManagement.removeFromCart(request, product_id)
# 
#     return redirect('/cart/cart_detail')


# Path: cart/urls.py
from cart.views import cartDetailView, removeFromCartView
from django.conf.urls import url
from django.contrib.auth.decorators import login_required



urlpatterns = [
    url(r'^cart_detail/', login_required(cartDetailView),
        name='cartDetailView'),
    url(r'^(?P<product_id>[0-9]+)/remove_from_cart/$',

        login_required(removeFromCartView),