To develop a Django application to store and retrieve data from a database using Object Relational Mapping(ORM).
Clone the repository from github
Create an admin page for Django.
create an app and edit settings.py
Makemigration and migrate the changes.
Create admin user and write python code for admin and models
Make all the migration to my app
Create a students database with 10 fields using runservercommand admin.py
from django.contrib import admin from .models import Student,StudentAdmin admin.site.register(Student,StudentAdmin)
models.py
from django.db import models from django.contrib import admin
class Student (models.Model): referencenumber=models.CharField(max_length=20,help_text="reference number") name=models.CharField(max_length=100) age=models.IntegerField() email=models.EmailField()
class StudentAdmin(admin.ModelAdmin): list_display=('referencenumber','name','age','email')
The program for creating a studentdatabase using ORM is executed successfully.