제품 쇼핑몰을 관리할 수 있는 관리 페이지 서비스
2022.10.21 ~ 2022.10.27 : 기능 구현
2022.10.29 : Azure 배포
2022.11.7 : AWS EC2 배포
장바구니 기능과 일자별로 총 매출, 제품별 판매수량, 제품별 매출을 볼 수 있는 쇼핑몰 관리 페이지
- Back-End : Python, Django, Django REST Framework, Dj Rest Auth, Django Allauth, Djangorestframework Simplejwt
- Database : SQLite, PostgreSQL
- Cloud : Azure
- ETC : Git, Github
- 실제 모델링
- 원하던 모델링
-
유저(3) :
username
으로 로그인 시 실패하는 테스트email
로 로그인 시 성공하는 테스트- JWT Token이 제대로 발급되는지 확인하는 테스트
-
장바구니(7) :
- CartViewSet CRUD 확인하는 테스트
- CartItemViewSet에 제품 추가, 수량조절, 삭제가 정상 작동하는지 확인하는 테스트
-
주문(2)
- OrderViewSet Update 실패하는 테스트
- OrderViewSet에 제품 정보가 잘 포함되는지 확인하는 테스트
-
상품(5)
- ProductViewSet CRRUD 확인하는 테스트
일자별 총 매출 = SELECT (date("order".order_date)) AS day,
SUM("order".total_price) AS day_total_sales
FROM "order"
WHERE "order".order_state="주문완료"
GROUP BY day
ORDER BY day ASC
일자별 제품별 판매수량 = SELECT (date(order_date)) AS day,
"order".product_id, SUM("order".product_quantity)
AS sales_quantity_per_product
FROM "order"
WHERE "order".order_state = "주문완료"
GROUP BY "order".product_id, day
ORDER BY day ASC
일자별 제품별 매출 = SELECT (date(order_date)) AS day,
"order"."product_id",
SUM("order"."total_price") AS sales_per_product
FROM "order"
WHERE "order"."order_state" = "주문완료"
GROUP BY "order"."product_id", day
ORDER BY "day" ASC
URL | Method | Description |
---|---|---|
api/accounts/password/reset | POST | 이메일을 통한 사용자 비밀번호 재설정 |
api/accounts/password/reset/confirm | POST | 사용자 비밀번호 재설정 및 새로운 토큰 발급 |
api/accounts/password/change | POST | 기존 비밀번호를 통해 비밀번호 재설정 |
api/accounts/login | POST | 사용자 로그인(토큰 반환) |
api/accounts/logout | POST | 사용자 로그아웃 |
api/accounts/token/verify | POST | 토큰 유효성 확인 |
api/accounts/token/refresh | POST | refresh 토큰을 통한 access 토큰 재발급 |
api/accounts/registration | POST | 사용자 회원가입 |
URL | Method | Action | Description |
---|---|---|---|
api/carts | GET | List | 장바구니 전체 목록 조회 |
api/carts | POST | Create | 장바구니 생성 |
api/carts/int:pk | GET | Retrieve | 장바구니 세부내역 조회 |
- 그 외 update, destory 불가
URL | Method | Action | Description |
---|---|---|---|
api/cart-items | GET | List | 장바구니 상품 전체 목록 조회 |
api/cart-items | POST | Create | 장바구니 상품 생성 |
api/cart-items/int:pk | GET | Retrieve | 장바구니 상품 세부내역 조회 |
api/cart-items/int:pk | PUT | Update | 장바구니 상품 업데이트 |
api/cart-items/int:pk | PATCH | Partial_Update | 장바구니 상품 세부내역 부분 업데이트 |
api/cart-items/int:pk | DELETE | Delete | 장바구니 상품 삭제 |
URL | Method | Action | Description |
---|---|---|---|
api/orders | GET | List | 주문서 전체 목록 조회 |
api/orders | POST | Create | 주문서 생성 |
api/orders/int:pk | GET | Retrieve | 주문서 세부내역 조회 |
- update,delete 불가
URL | Method | Description |
---|---|---|
api/orders/summary/v1 | GET | 요약(SQL) |
api/orders/summary/v2 | GET | 요약 웹페이지 (ORM) |
URL | Method | Action | Description |
---|---|---|---|
api/products | GET | List | 상품 전체 목록 조회 |
api/products | POST | Create | 상품 생성 |
api/products/int:pk | GET | Retrieve | 상품 세부내역 조회 |
api/products/int:pk | PUT | Update | 상품 세부내역 업데이트 |
api/products/int:pk | PATCH | Partial_Update | 상품 세부내역 부분 업데이트 |
api/products/int:pk | DELETE | Delete | 상품 삭제 |
-
배포