from django.contrib import admin from .models import Dish admin.site.register(Dish) Use code with caution. Copied to clipboard to log in: python manage.py createsuperuser Use code with caution. Copied to clipboard Follow the prompts to set your username and password. 🌐 Step 4: Create Views and URLs
Navigate to menu/models.py to define how your restaurant dishes are stored. Build A Restaurant Site With Python and Djangorar
Add 'menu' to the INSTALLED_APPS list in config/settings.py . 🍕 Step 2: Create the Database Model from django
This step-by-step guide will show you how to build a dynamic restaurant website using Python and the Django framework. 🚀 Why Use Django for a Restaurant Site? Django is a high-level Python web framework. 🌐 Step 4: Create Views and URLs Navigate to menu/models
Django provides a ready-to-use admin interface to manage your menu items. in menu/admin.py :
django-admin startproject config . python manage.py startapp menu Use code with caution. Copied to clipboard
mkdir restaurant_site cd restaurant_site python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` Use code with caution. Copied to clipboard pip install django Use code with caution. Copied to clipboard Start the project and app: