240416 Django 카트 구성하기

송용진·2024년 4월 16일

ICT COC
한국관광공사 x 카카오 2024 관광데이터 활용 공모전
K디지털트레이닝해커톤


Django 카트 구성하기

중화요리집

Lion 중화요리집에 오신 것을 환영합니다.

<div class="d-flex justify-content-end mb-3">
    <a href="{% url 'add_food' %}" class="btn btn-primary">제품 등록</a>
</div>
<div class="d-flex justify-content-end mb-3">
    <a href="{% url 'index' %}" class="btn btn-primary">고객 페이지로 이동</a>
</div>

<div class="row">
    <div class="col-md-6">
        <h3>카테고리</h3>
        <ul class="list-group">
        {% for cat in category %}
            <li class="list-group-item">{{cat.name}}</li> 
        {% endfor %}   
        </ul>
    </div>

    <div class="col-md-6">
        <h3>음식</h3>
        <div class="row">
        {% for f in food %}
            <div class="col-sm-6 col-md-4 mb-4">
                <div class="card">
                    <a href="{% url 'food_detail' pk=f.id %}">
                        <img src = "{{f.image_url}}" class="card-img-top food-image" alt="{{f.name}}">
                        <div class="card-body row">
                            <h5 class="card-title">{{f.name}}</h5>                                
                        </div>
                    </a>
                </div>
            </div>
        {% endfor %}    
        </div>
    </div>
</div>
​ #customer/urls.py from django.urls import path, include from . import views

app_name = "customer"

urlpatterns = [
path("",views.customer_index,name='index'),
]

#customer/views.py
from django.shortcuts import render
def customer_index(request):
return render(request,'customer/index.html')

고객 페이지에 오신 것을 환영합니다!

profile
개발자

0개의 댓글