Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Django
  • Views
  • Model
  • Template
  • Forms
  • Jinja
  • Python SQLite
  • Flask
  • Json
  • Postman
  • Interview Ques
  • MongoDB
  • Python MongoDB
  • Python Database
  • ReactJS
  • Vue.js
Open In App
Next Article:
Render Model in Django Admin Interface
Next article icon

Render Model in Django Admin Interface

Last Updated : 21 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Rendering model in admin refers to adding the model to the admin interface so that data can be manipulated easily using admin interface. Django's ORM provides a predefined admin interface that can be used to manipulate data by performing operations such as INSERT, SEARCH, SELECT, CREATE, etc. as in a normal database. To start entering data in your model and using admin interface, one needs to specify or render model in admin.py.

Render Model in Django Admin Interface Explanation

Consider a project named geeksforgeeks having an app named geeks. Let us initialize a model having fields title, content, views, URL, image, etc as in a blog. To know more about various fields and their implementations visit Django model data types and fields list. 

Refer to the following articles to check how to create a project and an app in Django. 

  • How to Create a Basic Project using MVT in Django?
  • How to Create an App in Django ?

Enter the following code into models.py file of geeks app.  

Python
from django.db import models from django.db.models import Model # Create your models here.  class GeeksModel(models.Model):     title = models.CharField(max_length = 200)     content = models.TextField(max_length = 200, null = True, blank = True)     views = models.IntegerField()     url = models.URLField(max_length = 200)     image = models.ImageField() 

One can easily create instances of this model using django shell but to access the admin panel and use admin panel for inserting, deleting or modifying the data following steps are to be followed: 

Before starting to use admin interface of django one needs to create superuser in django. A superuser is like an admin who can access and modify everything of a particular Django project. To create a superuser enter the following command into the terminal.

Python createsuperuser

Enter your Name, Email, Password, and confirm password. 

render-model-in-admin

Now let us login into the admin panel 

log-in-django-admin-models

Its time to render our model in this admin interface. Go to admin.py in geeks app and enter following code. Import the corresponding model from models.py and register it to the admin interface. 

Python
from django.contrib import admin  # Register your models here. from .models import GeeksModel  admin.site.register(GeeksModel) 

Now lets check our admin interface. visit http://localhost:8000/admin/ 

render-django-admin-interface-models

To add data into the model, tap add and enter corresponding data into the required fields. click on save. 

render-admin-django-models


Model GeeksModel has been successfully rendered into the admin interface. One can similarly render all types of models and any number of models in the Django Admin Interface. 

Read Next:

Customize Object Names with __str__ Method


Next Article
Render Model in Django Admin Interface

N

NaveenArora
Improve
Article Tags :
  • Python
  • Python Django
  • Django-models
Practice Tags :
  • python

Similar Reads

    Python | Django Admin Interface
    Prerequisites: Django Introduction and Installation Creating a ProjectThe Django Admin Interface is one of the most powerful features of the Django framework. It provides a ready-to-use interface for managing project data through models, allowing developers and site administrators to perform Create,
    3 min read
    Customize Django Admin Interface
    Django admin by default is highly responsive GUI, which offers various features and an overall CRUD application to help developers and users. Moreover, Django admin can be customized to fulfill one's needs such as showing fields on the home page of the table, etc. In this article, we will discuss ho
    3 min read
    How to Override CSS in Django Admin?
    Django's admin interface is a powerful tool for managing application data. It comes with a default styling that may not always fit the visual identity of your project. Customizing the admin interface can help create a more cohesive user experience. In this article, we'll walk you through the process
    3 min read
    How to Render Data in Django
    Django's render() function is a fundamental tool for building dynamic web applications. It simplifies the process of combining HTTP requests with HTML templates and dynamic data, making it easier for developers to create interactive and data-driven web pages.  What is render()?In Django, the render(
    3 min read
    Disable Admin-Style Browsable Interface of Django REST Framework
    Django REST Framework (DRF) is a powerful and flexible toolkit for building Web APIs in Django. One of its features is the browsable API, which provides a user-friendly, web-based interface for interacting with the API. While this can be helpful during development and debugging, it may not be desira
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences