Build A - Restaurant Site With Python And Djangorar

from django.contrib import admin from django.urls import path from menu.views import menu_list urlpatterns = [ path('admin/', admin.site.urls), path('', menu_list, name='menu_list'), ] Use code with caution. Copied to clipboard 🎨 Step 5: Design the HTML Template

django-admin startproject config . python manage.py startapp menu Use code with caution. Copied to clipboard Build A Restaurant Site With Python and Djangorar

Now, create the logic to fetch dishes from the database and display them. in menu/views.py : from django

from django.shortcuts import render from .models import Dish def menu_list(request): dishes = Dish.objects.all() return render(request, 'menu/menu_list.html', {'dishes': dishes}) Use code with caution. Copied to clipboard in config/urls.py : Build A Restaurant Site With Python and Djangorar