コード例 #1
0
ファイル: urls.py プロジェクト: ghrhome/GhrhomeCode
from django.conf.urls import patterns, include, url
from models import Item,Photo
# Uncomment the next two lines to enable the admin:
from views import IndexView,UploadImage,upload,ListDetail,ItemsList,ItemDetail,PhotoDetail

urlpatterns = patterns('',
	url(r'^$',IndexView.as_view(),name='index'),
	url(r'^uploadform/$',UploadImage),
	url(r'^upload/$',upload),
	url(r'^list/(?P<object_id>\d+)/$',ListDetail,name='list'),
	#url(r'^pages/', include('django.contrib.flatpages.urls'),name='pages'),
	
)

urlpatterns +=patterns('',

	url(r'^items/$',ItemsList.as_view(),name='item_list'),

	url(r'^items/(?P<pk>\d+)/$',ItemDetail.as_view(),name='item_detail'),
	url(r'photos/(?P<pk>\d+)/$',PhotoDetail.as_view(),name='photo_detail'),
	)
コード例 #2
0
ファイル: urls.py プロジェクト: SirBigG/la_reine
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from . import views
from views import ItemsList, PostsList, PostDetail


urlpatterns = [
    url(r'^$', views.index, name = 'index'),
    url(r'^items/', ItemsList.as_view() , name = 'items'),
    url(r'^posts/', PostsList.as_view() , name='posts'),
    url(r'^post/(?P<pk>\d+)/$', PostDetail.as_view() , name = 'post'),
    url(r'^feedback/', views.feedback, name = 'feedback'),
    url(r'feedback_valid/', views.feedback_valid, name = 'feedback_valid'),
    url(r'^put_to_basket/(?P<item_id>\d+)/$', views.put_to_basket, name = 'put_to_basket'),
    url(r'^basket/', views.basket, name = 'basket'),
    url(r'^del_from_basket/(?P<id>\d+)/$', views.del_from_basket, name = 'del_from_basket'),
    url(r'^empty_basket/', views.empty_basket, name='empty_basket'),
    url(r'^sale/' , views.sale, name = 'sale'),

] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)