Example #1
0
                  path('users/', include('users.urls')),

                  # path('login/', login_1, name='login'),
                  path('login/', LoginView.as_view(), name='login'),
                  path('register/', RegisterView.as_view(), name='register'),
                  path('logout/', LogoutView.as_view(), name='logout'),
                  re_path('active/(?P<active_code>.*)/', ActiveView.as_view(), name='active'),
                  # path('active/<str:code>', RegisterView.as_view(), name='register'),

                  path('forget/', ForgetView.as_view(), name='forget_pwd'),
                  path('reset/', ResetView.as_view(), name='reset_pwd'),

                  path('captcha/', include('captcha.urls')),

                  path('goods/', include('goods.urls')),
                  path('goods/<int:id>/', GoodDetailView.as_view(), name='good_detail'),
                  path('category/<int:id>/', CategoryView.as_view(), name='category'),

                  path('cart/', ShoppingCartView.as_view(), name='cart'),
                  path('order/', include('trade.urls')),
                  path('alipay/return/', AlipayView.as_view(), name='alipay'),

                  # re_path('static/(?P<path>.*)', serve, {"document_root": STATIC_ROOT}),
                  # re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}),

              ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# 404和500
handler404 = 'user_operation.views.page_not_found'
handler500 = 'user_operation.views.page_error'
Example #2
0
from django.conf.urls import url

from goods.views import CategoryView, DetailView, TidingsView, CityView

urlpatterns = [
    url(r'^category/$', CategoryView.as_view(), name='超市'),
    url(r'^detail/(?P<id>\d+)/$', DetailView.as_view(), name="详情"),
    url(r'^tidings/$', TidingsView.as_view(), name='消息中心'),
    url(r'^city/$', CityView.as_view(), name='城市'),
]
Example #3
0
from django.conf.urls import url

from goods.views import IndexView, CategoryView, DetailView

urlpatterns = [
    url(r'^$', IndexView.as_view(), name='首页'),
    url(r'^list/(?P<cate_id>\d*)_{1}(?P<order>\d?)\.html$',
        CategoryView.as_view(),
        name='商品列表'),
    url(r'^detail/(?P<id>\d+)/$', DetailView.as_view(), name='商品详情'),
]
Example #4
0
from django.conf.urls import url
# 页面缓存
from django.views.decorators.cache import cache_page

from goods.views import IndexView, CategoryView, DetailView

app_name = 'goods'
urlpatterns = [
    # url(r'^login/$', LoginView.as_view(), name="登录"),
    url(r'^goodsindex/$', IndexView.as_view(), name="商品首页"),
    url(r'^detail/(?P<id>\d+)', DetailView.as_view(), name="商品详情"),
    url(r'^list/(?P<cate_id>\d*)_{1}(?P<order>\d?)\.html$',
        cache_page(3600)(CategoryView.as_view()),
        name="商品分类列表"),
]
Example #5
0
from django.conf.urls.defaults import patterns, include, url

from goods.views import CategoryView, ProductView, AddCommentView, CommentVoteView

category_patterns = patterns('',
    url(r'^(?P<category>[\w.-]+)/$', CategoryView.as_view(), {'page': 1}),
    url(r'^(?P<category>[\w.-]+)/(?P<page>\d+|last)/$', CategoryView.as_view()),
)

products_patterns = patterns('',
    url(r'^(?P<pk>\d+)/$', ProductView.as_view()),
    url(r'^(?P<product_id>\d+)/add_comment/$', AddCommentView.as_view()),
    url(r'^(?P<product_id>\d+)/like_(?P<cid>\d+)/$', CommentVoteView.as_view(), {'mark': 1}),
    url(r'^(?P<product_id>\d+)/dislike_(?P<cid>\d+)/$', CommentVoteView.as_view(), {'mark': 0}),
)