Ejemplo n.º 1
0
#from django.urls import include,path,re_path
from django.conf.urls import url
from product.views import ProductCreate, ProductList, ProductUpdate

urlpatterns = [
    url(r'^$', ProductList.as_view(), name='productlist'),
    url(r'^new/$', ProductCreate.as_view(), name="newproduct"),
    url(r'^(?P<pk>[0-9]+)/update$',
        ProductUpdate.as_view(),
        name="editproduct"),
    #url(r'^(?P<pk>[0-9]+)/delete',MeetingDelete.as_view(),name="deletemeeting"),
]
Ejemplo n.º 2
0
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from user.views import index, RegisterView, LoginView, logout
from product.views import (
    ProductList,
    ProductCreate,
    ProductDetail,
    ProductListAPI,
    ProductDetailAPI,
)
from order.views import OrderCreate, OrderList

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    path('register/', RegisterView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', logout),
    path('product/', ProductList.as_view()),
    path('product/create/', ProductCreate.as_view()),
    path('product/<int:pk>/', ProductDetail.as_view()),
    path('order/', OrderList.as_view()),
    path('order/create/', OrderCreate.as_view()),
    path('api/product/', ProductListAPI.as_view()),
    path('api/product/<int:pk>/', ProductDetailAPI.as_view()),
]
Ejemplo n.º 3
0
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from fcuser.views import index, RegisterView, LoginView
from product.views import ProductList, ProductCreate, ProductDetail
from order.views import OrderCreate, OrderList

urlpatterns = [
    path("admin/", admin.site.urls),
    path("", index),
    path("register/",
         RegisterView.as_view()),  # 뷰클래스 사용시 as_view() 함수를 사용해야합니다
    path("login/", LoginView.as_view()),
    path("product/", ProductList.as_view()),
    path("product/<int:pk>/", ProductDetail.as_view()),
    # path("product/create", ProductCreate.as_view()) 로 입력해서 계속 에러가 났엇음 슬래시 주의할것
    path("product/create/", ProductCreate.as_view()),
    path("order/", OrderList.as_view()),
    path("order/create/", OrderCreate.as_view()),
]
Ejemplo n.º 4
0
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from stuser.views import index, RegisterView, LoginView
from product.views import ProductList, ProductCreate, ProductDetail
from order.views import OrderCreate

urlpatterns = [
    path('admin/', admin.site.urls, name='admin'),
    path('', index, name='index'),
    path('register/', RegisterView.as_view(), name='register'),
    path('login/', LoginView.as_view(), name='login'),
    path('product/', ProductList.as_view(), name='product'),
    path('product/<int:pk>/', ProductDetail.as_view(), name='productdetail'),
    path('product/create/', ProductCreate.as_view(), name='productcreate'),
    path('order/create/', OrderCreate.as_view(), name='ordercreate'),
]

#  path('admin/', admin.site.urls),
#     path('', index),
#     path('register/', RegisterView.as_view()),
#     path('login/', LoginView.as_view()),
#     path('product/', ProductList.as_view()),
#     path('product/<int:pk>/', ProductDetail.as_view()),
#     path('product/create/', ProductCreate.as_view()),
#     path('order/create/', OrderCreate.as_view()),
Ejemplo n.º 5
0
from django.conf.urls import patterns, url

from product.views import ProductList, ProductDetial

urlpatterns = patterns(
    '',
    url(r'^$', ProductList.as_view()),
    url(r'^(?P<pk>\d+)$', ProductDetial.as_view()),
)
Ejemplo n.º 6
0
"""fc_django URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

from product.views import product_main, ProductList, ProductRegistration, ProductDetail

urlpatterns = [
    path('', product_main),
    path('list/', ProductList.as_view()),
    path('list/<int:pk>/', ProductDetail.as_view()),
    path('registration/', ProductRegistration.as_view()),
]
Ejemplo n.º 7
0
from django.conf.urls import patterns, url

from product.views import ProductList, ProductDetial


urlpatterns = patterns('',
    url(r'^$', ProductList.as_view()),
    url(r'^(?P<pk>\d+)$', ProductDetial.as_view()),
)
Ejemplo n.º 8
0
from django.urls import path
from product.views import Detail, ProductList

urlpatterns = [
    path('s', ProductList.as_view()),
    path('/<int:product_id>', Detail.as_view())
]
Ejemplo n.º 9
0
from django.conf.urls import patterns, url
from django.contrib import admin
from product.views import ProductList, ProductDetail, CommentAdd

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^$', ProductList.as_view(), name='products'),
    url(r'^products/(?P<slug>.+)/comment/$', CommentAdd.as_view(), name='comment_add'),
    url(r'^products/(?P<slug>.+)/like/$', 'product.views.like', name='like'),
    url(r'^products/(?P<slug>.+)/$', ProductDetail.as_view(), name='product_view'),
                       )
Ejemplo n.º 10
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from product.views import ProductDetails, ProductList, ProductDetail
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from user.views import RegisterDetail, LoginDetail

urlpatterns = [
    path('api/products', ProductList.as_view()),
    path('api/products/<int:pk>', ProductDetail.as_view()),
    path('admin/', admin.site.urls),
    path('api-auth', include('rest_framework.urls')),
    path('api/token', TokenObtainPairView.as_view()),
    path('api/token/refresh', TokenRefreshView.as_view()),
    path('api/register', RegisterDetail.as_view()),
    path('api/login', LoginDetail.as_view()),
]
Ejemplo n.º 11
0
from django.urls import path

from product.views import ProductList, CategoryList, CompanyList

app_name = 'product'
urlpatterns = [
    path("", ProductList.as_view(), name="product"),
    path('category/', CategoryList.as_view(), name='category'),
    path('company/', CompanyList.as_view(), name='company')
]