django-admin startproject config . python manage.py startapp menu Use code with caution. Copied to clipboard
Navigate to menu/models.py to define how your restaurant dishes are stored. Build A Restaurant Site With Python and Djangorar
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 : django-admin startproject config
Now, create the logic to fetch dishes from the database and display them. in menu/views.py : Build A Restaurant Site With Python and Djangorar