Skip to content

SuryaR03/django-orm-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django ORM Web Application

AIM

To develop a Django application to store and retrieve data from a database using Object Relational Mapping(ORM).

Entity Relationship Diagram

ER diagram:

ERdiagram

DESIGN STEPS

STEP 1: create folder 'ex02' under the directory 'unit2'

STEP 2: clone the Github repository into the directory 'ex02' using the command "git clone "

STEP 3: under the folder "django-orm-app", enter the directory titled "dataproject" and enter the folder "dataproject" and go to the file "setting.py", "os" in line 14, set ALLOWED_HOST=['*'] and add 'myapp' under the list INSTALLED_APPS.

Write your own steps

PROGRAM

models.py:

from django.db import models from django.contrib import admin

class Student (models.Model): referencenumber=models.CharField(primary_key=True,max_length=20,help_text="reference number") name=models.IntegerField() age=models.IntegerField() email=models.IntegerField() phonenumber=models.IntegerField()

class StudentAdmin(admin.ModelAdmin): list_display=('referencenumber','name', 'age', 'email')

admin.py:

from django.contrib import admin from .models import Student,StudentAdmin

admin.site.register(Student,StudentAdmin)

OUTPUT

student:

Screenshot 2023-12-20 175743

error:

Screenshot 2023-12-20 175754

RESULT:

The Program is Executed Successfully.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%