Online College Admission Management System Python Project

Work on an interesting Python Django project – Online College Admission Management System

Before we start coding, let’s first look at some of the top features of the project:

  • Login and Sign up.
  • Different access rights to users (in our case student and admin).
  • Delete and add courses, without going to django admin site.
  • Detailed view of all courses.

We will develop this project using Django, It is an open-source Python-based web framework with a lot of inbuilt functionalities like UserCreationforms, login, and many more.

Project Prerequisites

We will use the following technologies:

  1. Python
  2. HTML
  3. CSS
  4. Bootstrap
  5. Django framework

To install the library, you can use the pip installer from cmd/terminal.

pip install Django

Download College Admission Course Project

Please download the code of Online college admission management system project: College Admission Management in Python

Steps to Build College Admission Management Project

Now, we will make a new project ‘GurukulMgmt’ and an app inside it. Run the following commands:

django-admin startproject GurukulMgmt
cd GurukulMgmt

django-admin startapp app

1. Writing Models

For database connectivity, we need the models. In the app/, create the following models.


from django.db import models

# Create your models here.
class Courses(models.Model):
    def __str__(self):
        return str(

The model class ‘Courses’ has four fields which are clear from the code. Now to create required model in the database, run following in commands:

Py makemigrations
Py migrate

2. To add more courses:


from django.forms import ModelForm
from .models import *

class CourseForm(ModelForm):
    class Meta:

This code is simpler because django does it all for us, we are just importing and calling the inbuilt functions.


Though we have already defined, but still sometimes we need to go to the admin panel and access the models. So we need to register the models in the


from django.contrib import admin
from .models import *
# Register your models here.

We also need a superuser who can access the models at admin site.To create a superuser:

py createsuperuser

4. Let’s set the url files

It is good practice to create a separate url file for each app. For this, we need to first include a new url file in project’s url file:


from django.contrib import admin
from django.urls import path,include

urlpatterns = [



from django.urls import path
from .views import *
from django.contrib.auth import views as auth_views

urlpatterns = [
    path('register/', registerPage,name='register'),
    path('login/', loginPage,name='login'),
    path('logout/', logoutPage,name='logout'),

Here, we are just making URLs for every function of the file.

5. Let’s finally work on ‘’ :


from django.shortcuts import render,redirect
from .models import *
from .forms import *
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login,logout,authenticate

# Create your views here.

def home(request):
    return render(request,'main.html',context)

def createCourse(request):
    if request.user.is_authenticated:
            if form.is_valid():
                return redirect('/')
        return render(request,'createCourse.html',context)
        return redirect('home')

def deleteCourse(request,pk):
    if request.user.is_authenticated:
            return redirect('/')
        return render(request,'delete.html',context)
        return redirect('home')

def description(request,pk):
    return render(request,'description.html',context)

def registerPage(request):
    if request.user.is_authenticated:
        return redirect('home')
        if request.method=='POST':
            if form.is_valid():
                return redirect('login')
        return render(request,'register.html',context)

def loginPage(request):
    if request.user.is_authenticated:
        return redirect('home')
       if request.method=="POST":
        if user is not None:
            return redirect('home')
       return render(request,'login.html',context)

def logoutPage(request):
    return redirect('login')

We have created seven functions in this file:

1. Home

It deals with the home page request for both the users (college staff and the student). It renders all the ‘course’ objects to home.html which displays all the details of the course and also checks whether the user is authenticated or not and displays everything based on its access rights.

Admin’s home page:

college admin home page

Student’s home page:

college student page

We can see that the navbar does not contain ‘Add more courses’ in the student’s page because a student cannot create a new course. Also, a student cannot delete a course, so the delete button is also removed.

2. CreateCourse

If the user has access rights (admin) then it will create new courses using the CourseForm object otherwise it will redirect the user to home page.

create course

3. DeleteCourse:

It first checks whether the user is authenticated or not. If the user is not authenticated (i.e. a student) then he cannot delete a course from the website, so it will redirect the user back to the home page. After checking the authenticity it allows deletion of the course.

delete course

4. Description:

It redirects the user to a description page which contains all the information of the requested course.

Rest are register, login, and logout which use inbuilt django functions.


Make a separate folder ‘templates’ in the project folder. This folder contains all the frontend files (html, css) and you can easily get them from the source code mentioned above.


We have successfully developed college admission management system project. This is a popular project among python django beginners. You can post all your doubts, issues in comment section and we will help you.

Happy Coding!

Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google | Facebook

2 Responses

  1. yogesh A R says:

    Gm sir, sir please give html templates sir

  2. Ramesh says:

    Please provide html templates files sir, I’m stuck in creating templates file..

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *