HAUS Connect - Python Project
Last Updated :
23 Jul, 2025
One of the most common problems faced by college students is that we have very erratic timetables and it is a cumbersome task to keep up with them, these issues have been amplified enormously during these pandemic times where everyone is on their own. The purpose of this application is to help students keep track of their classes, tests, and assignments as well as assist in streamlining communication between faculty and students. HAUS-Connect is a platform where faculty of college can schedule or reschedule the meetings or lectures, they also can set reminders for tests and upload study material too. A chatbot will help look for study material. Basically, we want to make sure that none of us miss any deadlines. At the moment this is for college students but its versatility is immense, it can be used on a large scale for communications throughout an enterprise, a single system that manages leaves granted, leave balance, pending work, etc.
Features
- Recorded lectures link, .ppt file, reference book pdf can be uploaded by the faculty.
- Time-Table modification access will be provided only to the faculty.
- A doubt section will be provided where a student has to upload a picture of his doubt and select the subject, a message on the faculty’s screen will pop and he further can send the solution of it.
- A chatbot will help look for study material
- A text message and email will be sent directly to all students if a faculty reschedules a particular meeting.
Tools Used:
Client-Side :
Server Side :
- MySQL database
- Python
- Sms API
- Django
Explanatory Diagram
Explanatory DiagramLogin Diagram
Login DiagramCode flow
Code flowStep by Step Implementation
Broadcaster: This is the folder that contains the files for the main project.
This file declares all the dependencies and other settings.
Python3
from pathlib import Path
import os
# Build paths inside the project like this:
# BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in
# production secret!
SECRET_KEY = 'django-insecure-lzy=xp#!(0e-h9+%u!dsj$m4-2+=j7r$5hsb((@7ziv2g=dgbt'
# SECURITY WARNING: don't run with debug turned
# on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'Teacher.apps.TeacherConfig',
'Student.apps.StudentConfig',
'Register.apps.RegisterConfig',
'crispy_forms',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'broadcaster.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'broadcaster.wsgi.application'
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.\
UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
NumericPasswordValidator',
},
]
# Internationalization
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
CRISPY_TEMPLATE_PACK = "bootstrap4"
LOGIN_REDIRECT_URL = "/"
# Default primary key field type
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
This file links URLs from different dependencies and other apps to the main project.
Python3
from django.contrib import admin
from django.urls import path, include
from Register import views as v
urlpatterns = [
path('admin/', admin.site.urls),
path('', include("Teacher.urls")),
path('', include("Student.urls")),
path('register/', v.register, name="register"),
path("", include("django.contrib.auth.urls")),
]
Now let's create the apps required for our project.
Register App
This app handles the login and signup of users.
Register hierarchy
Note: Static folder contains all the static files like JavaScript files, CSS files, and images
Templates Folder
You can see there is a template folder that contains two HTML files. The first file is register.html and the second file is login.html
HTML
<!-- Register -->
{%load static%}
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html>
<head>
<title>Login/SignUp</title>
<link rel="stylesheet" type="text/css" href="{% static 'Register/css/Login.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<div class="main">
<input type="checkbox" id="chk" aria-hidden="true">
<div class="signup">
<form method="post" class="form-group">
{% csrf_token %}
<label for="chk" aria-hidden="true">Sign up</label>
<div class="input">
{{form.username}}
</div>
<div class="input">
{{form.email}}
</div>
<div class="input">
{{form.password1}}
</div>
<div class="input">
{{form.password2}}
</div>
<button type="submit" class="btn btn-success"> Register </button>
</form>
<div class="error">
{{form.errors}}
</div>
</div>
<style>
.main{
width: 350px;
height: 500px;
background:red;
overflow: hidden;
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
.error{
color:#ffffff;
align-items: center;
}
</style>
<script>
var form_fields = document.getElementsByTagName('input')
form_fields[2].placeholder='Username..';
form_fields[3].placeholder='Email..';
form_fields[4].placeholder='Enter password...';
form_fields[5].placeholder='Re-enter Password...';
</script>
</div>
</body>
</html>
HTML
<!-- Login -->
{%load static%}
{% if user.is_authenticated %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">You are already logged in</p>
</center>
<h2 style="color:#f2f2f4"><a href="/" style="color:#f2f2f4">Click here</a> if you are a professor</h2>
<center>
<h2 style="color:#f2f2f4"><a href="/student_home" style="color:#f2f2f4">Click here</a> if you are a student</h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% else %}
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html>
<head>
<title>Login/SignUp</title>
<link rel="stylesheet" type="text/css" href="{% static 'Register/css/Login.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<div class="main">
<input type="checkbox" id="chk" aria-hidden="true">
<div class="signup">
<form method="post" class="form-group">
{% csrf_token %}
<label for="chk" aria-hidden="true">Login</label>
<div class="input">
{{form.username}}
</div>
<div class="input">
{{form.password}}
</div>
<button type="submit" class="btn btn-success"> Login </button>
</form>
<div class="error">
{{form.errors}}
<center>
<p>Dont have an account? create one <a href="{% url 'register'%}" style="color:white">here</a></p>
</center>
</div>
</div>
<style>
.main{
width: 350px;
height: 500px;
background:red;
overflow: hidden;
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
.error{
color:#ffffff;
align-items: center;
}
</style>
<script>
var form_fields = document.getElementsByTagName('input')
form_fields[].placeholder='Username..';
form_fields[].placeholder='Enter password...';
}
</script>
</div>
</body>
</html>
{% endif %}
apps.py
This registers the app since it will be using database.
Python3
from django.apps import AppConfig
class RegisterConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Register'
forms.py
Here a custom signup form is created.
Python3
from django import forms
from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegistrationForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
# order in which the fields show up
fields = ["email", "username", "password1", "password2"]
views.py
This file lets us manage how the page will be displayed and who will be able to see the page.
Python3
from django.shortcuts import render,redirect
from django.contrib.auth import login,authenticate,logout
from .forms import RegistrationForm
# Create your views here.
def register(request):
if request.user.is_authenticated:
return redirect("/")
if request.method == 'POST':
form=RegistrationForm(request.POST)
if form.is_valid():
form.save()
return redirect('login')
else:
form=RegistrationForm()
return render(request,"Register/register.html",{"form":form})
Student App
This app handles the student side of the project.
Student HierarchyTemplates:
About.html, ChatBot.html, faq.html, student_home.html and TimeTable.html
These pages are not visible to anyone that isn't logged in.
HTML
<!-- about -->
{% load static %}
{% if user.is_authenticated %}
<!DOCTYPE html>
<html>
<head>
<title>About Us</title>
<link
href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap"
rel="stylesheet"
/>
</head>
<style>
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: 'Jost', sans-serif;
background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
}
.main{
width: 350px;
height: 500px;
background: red;
overflow: hidden;
background: url("{% static 'image/1.jpg' %}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
label{
color: #fff;
font-size: 2.3em;
justify-content: center;
display: flex;
margin: 60px;
font-weight: bold;
transition: .5s ease-in-out;
}
p{
color: #fff;
font-size: 1.3em;
justify-content:flex-start;
display: flex;
margin: 20px;
font-weight: bold;
cursor: pointer;
transition: .5s ease-in-out;
}
.chk{
position: absolute;
top: 440px;
left: 250px;
}
h2{
margin: 2rem;
text-decoration-line:underline;
color:white;
}
li{
font-size: larger;
color:white;
}
</style>
<body>
<div class="main">
<div class="aanounce">
<label for="chk" aria-hidden="true">About</label>
<h2>HAUS Developers</h2>
<ul>
<li>Hardeep</li>
<li>Ahmed</li>
<li>Utsav</li>
<li>Sarthak</li>
</ul>
</div>
</div>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
HTML
<!-- Chat bot-->
{% load static %}
{% if user.is_authenticated %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatBot</title>
<link rel="stylesheet" href="{% static 'css/ChatBot.css' %}">
<link
href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700i"
rel="stylesheet"
/>
</head>
<body>
<main>
<section>
<br /><br /><br />
<h1>ChatBot</h1>
<small>Hi I am Era</small>
<br />
<p>
Under Construction
</p>
</section>
</main>
<style>
main{
background-image: url("{% static 'image/1.jpg' %}");
}
</style>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
HTML
<!-- faq-->
{% load static %}
{% if user.is_authenticated %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700i"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link rel="stylesheet" href="{% static 'css/faq.css' %}" />
<title>FAQ</title>
</head>
<body>
<h1>Frequently Asked Questions</h1>
<div class="faq-container">
<div class="faq active">
<h3 class="faq-title">
Why shouldn't we trust atoms?
</h3>
<p class="faq-text">
They make up everything
</p>
<button class="faq-toggle">
<i class="fas fa-chevron-down"></i>
<i class="fas fa-times"></i>
</button>
</div>
<div class="faq">
<h3 class="faq-title">
What do you call someone with no body and no nose?
</h3>
<p class="faq-text">
Nobody knows.
</p>
<button class="faq-toggle">
<i class="fas fa-chevron-down"></i>
<i class="fas fa-times"></i>
</button>
</div>
<div class="faq">
<h3 class="faq-title">
What's the object-oriented way to become wealthy?
</h3>
<p class="faq-text">
Inheritance.
</p>
<button class="faq-toggle">
<i class="fas fa-chevron-down"></i>
<i class="fas fa-times"></i>
</button>
</div>
<div class="faq">
<h3 class="faq-title">
How many tickles does it take to tickle an octopus?
</h3>
<p class="faq-text">
Ten-tickles!
</p>
<button class="faq-toggle">
<i class="fas fa-chevron-down"></i>
<i class="fas fa-times"></i>
</button>
</div>
<div class="faq">
<h3 class="faq-title">
What is: 1 + 1?
</h3>
<p class="faq-text">
Depends on who are you asking.
</p>
<button class="faq-toggle">
<i class="fas fa-chevron-down"></i>
<i class="fas fa-times"></i>
</button>
</div>
</div>
<script src="{% static 'js/faq.js' %}"></script>
<style>
body{
background: url("{%static 'image/1.jpg'%}") no-repeat center/ cover;}
</style>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
HTML
<!-- student_home -->
{% load static %}
{% if user.is_authenticated %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Student's Portal</title>
<link
href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700i"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"
integrity="sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w=="
crossorigin="anonymous"
/>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<style>
html,
body {
height: 100%;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: "Roboto Condensed", sans-serif;
line-height: 1.7;
perspective-origin: 0% 50%;
perspective: 800px;
background: #21212d;
}
nav,
main {
transition: transform 150ms ease-out;
}
nav {
z-index: 100;
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 16em;
background-color: #353441;
transform: translateX(-16em);
}
nav.menu-active {
transform: translateX(0);
}
nav.menu-hover {
transform: translateX(-15em);
}
nav h1 {
z-index: 100;
display: block;
position: absolute;
top: 0;
right: -65px;
height: 60px;
width: 65px;
line-height: 60px;
font-size: 0.8em;
font-weight: 300;
letter-spacing: 1px;
color: #fff;
text-transform: uppercase;
text-align: center;
background-color: #353441;
cursor: pointer;
}
nav h1:hover {
color: #353441;
background: #fff;
}
nav ul {
margin: 0;
padding: 0;
}
nav li {
display: inline-block;
padding: 0 1em;
width: 100%;
height: 60px;
color: #9dc6d1;
line-height: 60px;
background-color: #353441;
transition: all 0.5s ease-in;
}
nav li:nth-of-type(2n) {
background-color: #3a3947;
}
nav li:hover {
background: #6d44b8;
color: rgb(255, 255, 255);
}
main {
z-index: 0;
position: absolute;
top: 0;
left: 0%;
bottom: 0;
right: 0;
display: flex;
align-items: center;
overflow: hidden;
background-image: url("{% static 'image/1.jpg' %}");
transform-origin: 0% 50%;
background-size: 35%;
width: 100%;
}
main:after {
content: "";
display: block;
position: absolute;
z-index: 1;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: linear-gradient(
to right,
transparent,
rgba(33, 33, 45, 0.5)
);
visibility: hidden;
opacity: 0;
transition: opacity 150ms ease-out, visibility 0s 150ms;
}
main.menu-active {
border-radius: 0.001px;
transform: translateX(16em) rotateY(15deg);
}
main.menu-active:after {
visibility: visible;
opacity: 1;
transition: opacity 150ms ease-out, visibility 0s;
}
main.menu-hover {
border-radius: 0.001px;
transform: translateX(1em) rotateY(1deg);
}
main section {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
padding: 1em 4em;
max-width: 680px;
overflow: auto;
background-color: rgba(255, 255, 255, 0.753);
}
section h1 {
font-weight: 800;
font-size: 2em;
}
section p {
display: inline-block;
margin: 16px 0;
}
nav h1 button {
cursor: pointer;
position: absolute;
top: -17px;
left: 30%;
height: 100px;
background-color: transparent;
border: 0;
font-size: 26px;
color: #fff;
}
nav h1 button:hover {
color: #353441;
}
.logo {
z-index: 1;
position: absolute;
width: 150px;
top: 0;
left: 82%;
}
.box {
display: flex;
border: 2px solid black;
height: 50vh;
border-radius: 5px;
box-shadow: 5px 20px 50px #000;
padding-bottom: 2rem;
}
h3 {
margin: 15px;
padding-top: 1rem;
}
.copyright{
margin-top: 2rem;
font-family: sans-serif;
text-align: center;
}
.copyright hr{
background-color: black;
}
</style>
</head>
<body>
<nav class="menu-activea">
<h1 class="hamb">
<button id="open">
<i class="fas fa-bars"></i>
</button>
</h1>
<ul>
<a href="{% url 'ChatBot'%}" rel="noopener noreferrer" style="text-decoration:none ;color: #fff; " >
<li style="cursor: pointer">
CHATBOT
</li>
</a>
<li
onclick="location.href=' https://drive.google.com/drive/folders/13aPy9KoDX3AWbkeech2AK-EBitiXEcNT';"
style="cursor: pointer">
NOTES
</li>
<a href="{% url 'TimeTable'%}" rel="noopener noreferrer" style="text-decoration:none;color: #fff; ">
<li style="cursor: pointer">
TIMETABLE
</li>
</a>
<a href="{% url 'Result'%}" rel="noopener noreferrer" style="text-decoration:none ;color: #fff; ">
<li style="cursor: pointer">
RESULT
</li>
</a>
<a href="{% url 'About'%}" rel="noopener noreferrer" style="text-decoration:none ;color: #fff; ">
<li>
ABOUT
</li>
</a>
<a href="{% url 'FAQ'%}" rel="noopener noreferrer" style="text-decoration:none ;color: #fff; ">
<li style="cursor: pointer">
FAQ
</li>
</a>
<a href="{% url 'logout'%}" rel="noopener noreferrer" style="text-decoration:none ;color: #fff;">
<li style="cursor: pointer">
LOGOUT
</li>
</a>
</ul>
</nav>
<main>
<img class="logo" src="{% static 'image/HAUS.png' %}" >
<section>
<br /><br /><br />
<h1>HAUS-Connect</h1>
<small>Student's Portal</small>
<br />
<div class="container">
<p>
HAUS-Connect is platform where all the faculties can send notice,Schedule Exam and Schedule Lectures. Any action performed by faculty will send a text message to all the students informing them about any upcoming events. HAUS-Connect aims to decrease the ridge between Student and Faculty.It is a firm of the Students,by the Students, for the Students.
</p>
</div>
<div class="container">
<h3>Announcement </h3>
<div class="box">
<center>
{% for t in t1 %}
{{ t }}<br>
{% endfor %}
</center>
</div>
</div>
<div class="container">
<h3>Lectures</h3>
<div class="box">
{% for t in t2 %}
You have a {{t.subject}}
extra class on {{t.date}}
from {{t.time_start}}
to {{t.time_end}}
<br>
{% endfor %}
</div>
</div>
<div class="container">
<h3>Exam</h3>
<div class="box">
{% for t in t3 %}
You have a {{t.subject}}
extra class on {{t.date}}
from {{t.time_start}}
to {{t.time_end}}
<br>
{% endfor %}
</div>
</div>
<div class="copyright">
<hr>
<h3>
© 2021 HAUS - All Rights Reserved
</h3>
</div>
</section>
</main>
<script>
(function () {
var nav = $("nav"),
menu = $("nav h1"),
main = $("main"),
open = false,
hover = false;
menu.on("click", function () {
open = !open ? true : false;
nav.toggleClass("menu-active");
main.toggleClass("menu-active");
nav.removeClass("menu-hover");
main.removeClass("menu-hover");
console.log(open);
});
menu.hover(
function () {
if (!open) {
nav.addClass("menu-hover");
main.addClass("menu-hover");
}
},
function () {
nav.removeClass("menu-hover");
main.removeClass("menu-hover");
}
);
})();
</script>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
HTML
<!-- Time Table -->
{% load static %}
{% if user.is_authenticated %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TIMETABLE</title>
<link rel="stylesheet" type="text/css" href="{% static 'css/Timetable.css' %}" />
</head>
<body>
<div class="limiter">
<div class="container-table100" >
<div class="wrap-table100">
<div class="table100 ver3">
<table data-vertable="ver3">
<thead>
<tr class="row100 head">
<th class="column100 column1" data-column="column1"></th>
<th class="column100 column2" data-column="column2">
Sunday
</th>
<th class="column100 column3" data-column="column3">
Monday
</th>
<th class="column100 column4" data-column="column4">
Tuesday
</th>
<th class="column100 column5" data-column="column5">
Wednesday
</th>
<th class="column100 column6" data-column="column6">
Thursday
</th>
<th class="column100 column7" data-column="column7">
Friday
</th>
<th class="column100 column8" data-column="column8">
Saturday
</th>
</tr>
</thead>
<tbody>
<tr class="row100">
<td class="column100 column1" data-column="column1">
8:00 AM - 9:00 AM
</td>
<td class="column100 column2" data-column="column2">
--
</td>
<td class="column100 column3" data-column="column3">Data Structures</td>
<td class="column100 column4" data-column="column4">Digital Electronics</td>
<td class="column100 column5" data-column="column5">Microprocessor Programming</td>
<td class="column100 column6" data-column="column6">OOPS With Java</td>
<td class="column100 column7" data-column="column7">
Open Elective
</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
9:00 AM - 10:00 AM
</td>
<td class="column100 column2" data-column="column2">--</td>
<td class="column100 column3" data-column="column3">
Discrete Math
</td>
<td class="column100 column4" data-column="column4">
Discrete Math
</td>
<td class="column100 column5" data-column="column5">OOPS With Java</td>
<td class="column100 column6" data-column="column6">
Data Structures
</td>
<td class="column100 column7" data-column="column7">Data Structures - Lab</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
10:00 AM - 11:00 AM
</td>
<td class="column100 column2" data-column="column2">
--
</td>
<td class="column100 column3" data-column="column3">Open Elective</td>
<td class="column100 column4" data-column="column4">Data Structures - Lab</td>
<td class="column100 column5" data-column="column5">Data Structures</td>
<td class="column100 column6" data-column="column6">Discrete Math</td>
<td class="column100 column7" data-column="column7">
OOPS With Java
</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
11:00 AM - 12:00 PM
</td>
<td class="column100 column2" data-column="column2">--</td>
<td class="column100 column3" data-column="column3">
Microprocessor Programming - Lab
</td>
<td class="column100 column4" data-column="column4">
OOPS With Java
</td>
<td class="column100 column5" data-column="column5">Open Elective</td>
<td class="column100 column6" data-column="column6">
Digital Electronics - Lab
</td>
<td class="column100 column7" data-column="column7">Microprocessor Programming</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
12:00 PM - 1:00 PM
</td>
<td class="column100 column2" data-column="column2">
--
</td>
<td class="column100 column3" data-column="column3">Digital Electronics</td>
<td class="column100 column4" data-column="column4">Microprocessor Programming</td>
<td class="column100 column5" data-column="column5">
Discrete Math - Tutorial
</td>
<td class="column100 column6" data-column="column6">Microprocessor Programming - Lab</td>
<td class="column100 column7" data-column="column7">
OOPS With Java - Lab
</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
1:00 PM - 2:00 PM
</td>
<td class="column100 column2" data-column="column2">--</td>
<td class="column100 column3" data-column="column3">
Discrete Math
</td>
<td class="column100 column4" data-column="column4">
OOPS With Java - Lab
</td>
<td class="column100 column5" data-column="column5">Data Structures</td>
<td class="column100 column6" data-column="column6">Digital Electronics</td>
<td class="column100 column7" data-column="column7">Discrete Math</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
2:00 PM - 3:00 PM
</td>
<td class="column100 column2" data-column="column2">
--
</td>
<td class="column100 column3" data-column="column3">--</td>
<td class="column100 column4" data-column="column4">--</td>
<td class="column100 column5" data-column="column5">--</td>
<td class="column100 column6" data-column="column6">--</td>
<td class="column100 column7" data-column="column7">
--
</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
<tr class="row100">
<td class="column100 column1" data-column="column1">
3:00 PM - 4:00 PM
</td>
<td class="column100 column2" data-column="column2">--</td>
<td class="column100 column3" data-column="column3">--</td>
<td class="column100 column4" data-column="column4">--</td>
<td class="column100 column5" data-column="column5">--</td>
<td class="column100 column6" data-column="column6">--</td>
<td class="column100 column7" data-column="column7">--</td>
<td class="column100 column8" data-column="column8">--</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!--===============================================================================================-->
<script src="{% static 'js/jquery.js' %}"></script>
<!--===============================================================================================-->
<script src="{% static 'js/TimeTable.js' %}"></script>
<style>
.container-table100{
background: url("{%static 'image/1.jpg'%}") no-repeat center/ cover;}
</style>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
views.py
This file lets us manage how the page will be displayed and who will be able to see the page.
Python3
from Teacher.models import Announcements, Exam, Class
from django.shortcuts import render
from django.contrib.auth import logout
from django.http import HttpResponse, HttpResponseRedirect
# Create your views here.
def home(response):
t1 = Announcements.objects.all()
t2 = Class.objects.all()
t3 = Exam.objects.all()
return render(response, "Student/student_home.html",
{"t1": t1, "t2": t2, "t3": t3})
def chatbot(response):
return render(response, "Student/ChatBot.html")
def timetable(response):
return render(response, "Student/TimeTable.html")
def result(response):
return render(response, "Student/Result.html")
def faq(response):
return render(response, "Student/faq.html")
def logout_request(request):
logout(request)
return render(request, "Student/student_home.html", {})
def about(request):
return render(request, "Student/About.html", {})
urls.py
Here we set paths for our templates.
Python3
from django.urls import path
from . import views
urlpatterns = [
path("student_home/", views.home, name="Home"),
path("chatbot/", views.chatbot, name="ChatBot"),
path("FAQ/", views.faq, name="FAQ"),
path("Result/", views.result, name="Result"),
path("TimeTable/", views.timetable, name="TimeTable"),
path("logout/", views.logout_request, name="logout"),
path("about/", views.about, name="About")
]
Teachers App
This app handles the teachers side of the project.

Templates:
All these pages are not visible to anyone that is not logged in and the accounts with 'student' status are not allowed to use them.
HTML
<!-- Announcement.html-->
{% load static %}
<!DOCTYPE html>
<html>
{% if user.is_authenticated %}
<head>
<title>Create Announcement</title>
<link rel="stylesheet" type="text/css" href="{% static 'Teacher/css/announcement.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<div class="main">
<div class="aanounce">
<label for="chk" aria-hidden="true">Announcement</label>
<form method="POST" action="/announcement/">
{% csrf_token %}
<div class="input">
{{form.text}}
</div>
<br>
<p>Tick this to send message
{{form.check}}
</p>
<br>
<br>
<button type="submit",name="save"> Send </button>
</form>
</div>
</div>
<style>
.main{
width: 350px;
height: 500px;
background: red;
overflow: hidden;
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
</style>
<script>
var form_fields = document.getElementsByTagName('input')
form_fields[1].placeholder='Write your announcement';
</script>
</body>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
</html>
HTML
<!-- Base.html-->
{% load static %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center><p style="color:#f2f2f4">You dont have authorization to access this page. </p>
</center>
<center><p style="color:#f2f2f4">If you are a professor contact administrator. </p>
</center>
<center> <h2 style="color:#f2f2f4"><a href="/student_home" style="color:#f2f2f4">Click here</a> if you are a student</h2></center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
HTML
<!-- Class.html-->
{% load static %}
<!DOCTYPE html>
<html>
{% if user.is_authenticated %}
<head>
<title>Schedule Class</title>
<link rel="stylesheet" type="text/css" href="{% static 'Teacher/css/class.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<div class="main">
<form method="POST" action="/class/">
<br>
<br>
<label for="chk" aria-hidden="true">Class</label>
{% csrf_token %}
<br>
<p>
{{form.subject.label}}
{{form.subject}}
</p>
<p>
{{form.date.label}}
{{form.date}}
</p>
<p>
{{form.time_start.label}}
{{form.time_start}}
</p>
<p>
{{form.time_end.label}}
{{form.time_end}}
</p>
<p>
{{form.check.label}}
{{form.check}}
</p>
<button type="submit",name="save"> Schedule Class </button>
</form>
</div>
<style>
.main{
width: 350px;
height: 590px;
background: red;
overflow: hidden;
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
</style>
<script>
var form_fields = document.getElementsByTagName('input')
form_fields[1].placeholder='Subjcet';
form_fields[2].placeholder='DD/MM/YY';
form_fields[3].placeholder='HH:MM AM/PM';
form_fields[4].placeholder='HH:MM AM/PM';
</script>
</body>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center><p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center> <h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2></center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
</html>
HTML
<!-- Exam.html -->
{% load static %}
<!DOCTYPE html>
<html>
{% if user.is_authenticated %}
<head>
<title>Schedule Exam</title>
<link rel="stylesheet" type="text/css" href="{% static 'Teacher/css/exam.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<div class="main">
<form method="POST" action="/exam/">
<br>
<label for="chk" aria-hidden="true">Exam</label>
{% csrf_token %}
<br>
<p>
{{form.subject.label}}
{{form.subject}}
</p>
<p>
{{form.date.label}}
{{form.date}}
</p>
<p>
{{form.time_start.label}}
{{form.time_start}}
</p>
<p>
{{form.time_end.label}}
{{form.time_end}}
</p>
<p>
{{form.check.label}}
{{form.check}}
</p>
<br>
<button type="submit",name="save"> Schedule Exam </button>
</form>
</div>
</body>
<style>
.main{
width: 350px;
height: 590px;
background: red;
overflow: hidden;
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
</style>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center><p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center> <h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2></center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
</html>
HTML
<!-- home.html -->
{% load static %}
<!DOCTYPE html>
<html lang="en">
{% if user.is_authenticated %}
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"
integrity="sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w=="
crossorigin="anonymous"
/>
<link rel="stylesheet" href="{% static 'Teacher/css/style.css' %}" />
<title>Teacher's Portal</title>
<img class="pdeu" src="{% static 'Teacher/images/h1.png' %}" alt="PDEU">
</head>
<body>
<!------------------------------------------------------>
{% include 'Teacher/messages.html' %}
<!------------------------------------------------------>
<div class="container">
<div class="content">
<h1>HAUS-Connect</h1>
<small>Teacher's Portal</small>
<p>
Basically, here all Faculty's can send notice , Schedule Exam and Schedule Lectures. Any action performed by Faculty will send a text message to all students informing them about any upcoming events. HAUS-Connect aims to decrease the ridge between Student and Faculty.It is a firm of the Students,by the Students, for the Students.
</p>
<h2>TimeTable</h2>
<small>*Note this is fixed timetable provided by the institution </small>
<div class="container1">
<div
class="panel active"
style="
background-image: url(https://drive.google.com/uc?export=view&id=1EYoNIJNZe7s7cFA3rBvNxesi-TZONIoe);
"
>
</div>
<div
class="panel"
style="
background-image: url(https://drive.google.com/uc?export=view&id=1MKpz6fFHogku_2f-9JUOkqBwT36VgITb);
"
>
</div>
<div
class="panel"
style="
background-image: url(https://drive.google.com/uc?export=view&id=1Jytl4YnqtN5-hVqmciOVy-WQc5UfUuyB);
"
>
</div>
<div
class="panel"
style="
background-image: url(https://drive.google.com/uc?export=view&id=1KB4D5-qJUelFc_Xa6ZmfTmKdM_zD6f52);
"
>
</div>
<div
class="panel"
style="
background-image: url(https://drive.google.com/uc?export=view&id=1-VDdpedgkyjlYWMrraIcafjC-YTduY0O);
"
>
</div>
</div>
<p>
We the students of PDEU CE`20 batch, appreciate you for putting all your efforts and helping us throughout the day from solving our 'silly' doubts to help us in any problem which we faced during college.
</p>
<small>-Thanking You.</small>
<div class="copyright">
<hr>
<h3>
© 2021 HAUS - All Rights Reserved
</h3>
</div>
</div>
</div>
<div class="circle-container">
<div class="circle">
<button id="close">
<i class="fas fa-times"></i>
</button>
<button id="open">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
<nav>
<ul>
<li>
<a href="{% url 'Announcement'%}" title="" rel="noopener noreferrer"><i class="fas fa-bullhorn"></i>Notice</a>
</li>
<li>
<a href="{% url 'Extra Class'%}" rel="noopener noreferrer"><i class="fas fa-book"></i>Class</a>
</li>
<li>
<a href="{% url 'Exams'%}" rel="noopener noreferrer"><i class="fas fa-graduation-cap"></i>Exam</a>
</li>
<li >
<a href="{% url 'logout'%}" rel="noopener noreferrer"><i class="fas fa-sign-out-alt" aria-hidden="true"></i>Logout</a>
</li>
</ul>
</nav>
<script src="{% static 'Teacher/js/app.js' %}"></script>
<script src="{% static 'Teacher/js/app1.js' %}"></script>
</body>
</html>
{% else %}
<html>
<head>
<title>
{% block title %}Please Login {% endblock %}
</title>
</head>
<body class="main">
<h1 class="ml5">
<span class="text-wrapper">
<span class="line line1"></span>
<span class="letters letters-left">HAUS</span>
<span class="letters ampersand">~</span>
<span class="letters letters-right">Connect</span>
<span class="line line2"></span>
</span>
</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<center>
<p style="color:#f2f2f4">Sadly you are not logged in</p>
</center>
<center>
<h2><a href="/login" style="color:#f2f2f4"> Login Here</a></h2>
</center>
</body>
<link rel="stylesheet" href="{% static 'Teacher/css/base.css' %}">
<script type="text/javascript" src="{% static 'Teacher/js/base.js' %}"></script>
<style>
.main{
background: url("{%static 'Register/images/1.jpg'%}") no-repeat center/ cover;
}
</style>
</html>
{% endif %}
HTML
<!--Logout.html-->
<html>
<head>
<title>
Login here
</title>
</head>
{% load crispy_forms_tags %}
<body>
<h1>Register Here</h1>
<form method="post" class="form-group">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-success"> Log in </button>
<p>Dont have an account? Create one <a href="/register">here </a></p>
</form>
</body>
</html>
HTML
<!-- message.html-->
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} m-2" id='msg' role='alert'>
<center>{{message}}</center>
</div>
<script>
setTimeout(function(){
if ($('#msg').length>0){
$('#msg').remove();
}
},2000)
</script>
{% endfor %}
{% endif %}
admin.py
This is used to register the models which will use database
Python3
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Announcements)
admin.site.register(Class)
admin.site.register(Exam)
apps.py
Register the app
Python3
from django.apps import AppConfig
class TeacherConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Teacher'
decorator.py
This file enables us to restrict access to pages.
Python3
from django.http import HttpResponse
from django.shortcuts import redirect, render
def allowed_users(allowed_roles=[]):
def decorator(view_func):
def wrapper_func(request, *args, **kwargs):
group = None
if request.user.groups.exists():
group = request.user.groups.all()[0].name
if group in allowed_roles:
return view_func(request, *args, **kwargs)
else:
return render(request, "Teacher/base.html", {})
return wrapper_func
return decorator'
forms.py
Creation of forms
Python3
from django import forms
class createnewannouncement(forms.Form):
text = forms.CharField(label="Announcement", max_length=1000)
check = forms.BooleanField(label="Send message", required=False)
class schedule_extra_class(forms.Form):
subject = forms.CharField(label="Subject", max_length=20)
date = forms.CharField(label="Date", max_length=20)
time_start = forms.CharField(label="Starting Time", max_length=20)
time_end = forms.CharField(label="Ending Time", max_length=20)
check = forms.BooleanField(label="Send message", required=False)
class schedule_exam(forms.Form):
subject = forms.CharField(label="Subject ", max_length=20)
date = forms.CharField(label="Date", max_length=20)
time_start = forms.CharField(label="Starting Time", max_length=20)
time_end = forms.CharField(label="Ending Time", max_length=20)
check = forms.BooleanField(label="Send message", required=False)
models.py
This sets up databases for the forms to save data in
Python3
from django.db import models
class Announcements(models.Model):
text = models.TextField(max_length=500)
def __str__(self):
return self.text
class Class(models.Model):
subject = models.TextField(max_length=50)
date = models.TextField(max_length=50)
time_start = models.TextField(max_length=5)
time_end = models.TextField(max_length=5)
message = "You have a {0} extra class on {1} from {2} to {3}".format(
str(subject), str(date), str(time_start), str(time_end))
def __str__(self):
message = "You have a {0} extra class on {1} from {2} to {3}".format(
str(self.subject), str(self.date), str(self.time_start), str(self.time_end))
return self.message
class Exam(models.Model):
subject = models.TextField(max_length=50)
date = models.TextField(max_length=50)
time_start = models.TextField(max_length=5)
time_end = models.TextField(max_length=5)
message = "You have a {0} exam on {1} from {2} to {3}".format(
str(subject), str(date), str(time_start), str(time_end))
def __str__(self):
message = "You have a {0} exam on {1} from {2} to {3}".format(
str(self.subject), str(self.date), str(self.time_start), str(self.time_end))
return self.message
sending_messages.py
This file is responsible for sending messages to the provided numbers
Python3
def send_message(message):
from twilio.rest import Client
client = Client("Account SId", "Auth token")
numbers = ["+916351816925", "+91xxxxxxxxxx",
"+91xxxxxxxxxx", "+91xxxxxxxxxx"]
names = ["Sarthak", "Hardeep", "Utsav", "Ahmed"]
for i in range(4):
m = ("Hello {} ".format(names[i]))+message
client.messages.create(to=numbers[i],
from_="number provided by the api",
body=(m))
urls.py
Links templates to addresses
Python3
from django.urls import path
from . import views
urlpatterns = [
path("", views.home, name="Home"),
path("<int:id>", views.index, name="index"),
path("announcement/", views.create_announcement, name="Announcement"),
path("class/", views.create_class, name="Extra Class"),
path("exam/", views.create_exam, name="Exams"),
path("logout/", views.logout_request, name="logout"),
path("base/", views.base, name="Base"),
]
views.py
This file lets us manage how the page will be displayed and who will be able to see the page. Also this is where we use the decorator.py to restrict access.
Python3
from datetime import date
from django.shortcuts import render
from django.contrib.auth import logout
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib import messages
from .decorator import allowed_users
from .models import *
from .forms import *
from .Sending_messages import *
def base(request):
return render(request, "Teacher/base.html")
@allowed_users(allowed_roles=['admin', 'Professor'])
def home(response):
return render(response, "Teacher/home.html")
def logout_request(request):
logout(request)
return render(request, "Teacher/home.html", {})
@allowed_users(allowed_roles=['admin', 'Professor'])
def index(response, id):
a = Announcements.objects.get(id=id)
return render(response, "Teacher/home.html", {})
@allowed_users(allowed_roles=['admin', 'Professor'])
def create_announcement(response):
if response.method == "POST":
form = createnewannouncement(response.POST)
if form.is_valid():
t = form.cleaned_data["text"]
a = Announcements(text=t)
a.save()
if form.cleaned_data["check"] == True:
send_message(t)
messages.success(
response, 'Announcement was saved and messages are sent')
else:
messages.success(response, 'Announcement was saved')
return render(response, "Teacher/home.html", {})
else:
form = createnewannouncement()
return render(response, "Teacher/announcement.html", {"form": form})
@allowed_users(allowed_roles=['admin', 'Professor'])
def create_class(response):
if response.method == "POST":
form = schedule_extra_class(response.POST)
if form.is_valid():
c1 = form.cleaned_data["subject"]
c2 = form.cleaned_data["date"]
c3 = form.cleaned_data["time_start"]
c4 = form.cleaned_data["time_end"]
c = Class(subject=c1, date=c2, time_start=c3, time_end=c4)
c.save()
t = "You have a {0} extra class on {1} from {2} to {3}".format(
str(c1), str(c2), str(c3), str(c4))
if form.cleaned_data["check"] == True:
send_message(t)
messages.success(
response, 'Class is scheduled and messages are sent')
else:
messages.success(response, 'Class is scheduled')
return render(response, "Teacher/home.html", {"text": t})
else:
form = schedule_extra_class()
return render(response, "Teacher/class.html", {"form": form})
@allowed_users(allowed_roles=['admin', 'Professor'])
def create_exam(response):
if response.method == "POST":
form = schedule_exam(response.POST)
if form.is_valid():
e1 = form.cleaned_data["subject"]
e2 = form.cleaned_data["date"]
e3 = form.cleaned_data["time_start"]
e4 = form.cleaned_data["time_end"]
e = Exam(subject=e1, date=e2, time_start=e3, time_end=e4)
e.save()
t = "You have a {0} exam on {1} from {2} to {3}".format(
str(e1), str(e2), str(e3), str(e4))
if form.cleaned_data["check"] == True:
send_message(t)
messages.success(
response, 'Exam is scheduled and messages are sent')
else:
messages.success(response, 'Exam is scheduled')
return render(response, "Teacher/home.html", {"text": t})
else:
form = schedule_exam()
return render(response, "Teacher/exam.html", {"form": form})
Output
Login Page:
LOGIN PAGEInsights from Teacher's portal:
Teacher's Portal - HOMEPAGE
Teacher's Portal-NOTICE / ANNOUNCEMENT TAB
There are also other tabs like exam and class in which faculty can schedule an exam and class.
Insight from Student's portal:
Student's Portal-HOME PAGE
Student's Portal-TIMETABLE TAB
Student's Portal - RESULT TAB
Student's portal - ABOUT US & FAQ TAB
There also exist other tabs like chatbot and notes.
Logout Option:
LOGOUT PAGE
GitHub Link - HAUS-Connect
Team members
Similar Reads
Python Tutorial - Learn Python Programming Language Python is one of the most popular programming languages. Itâs simple to use, packed with features and supported by a wide range of libraries and frameworks. Its clean syntax makes it beginner-friendly. It'sA high-level language, used in web development, data science, automation, AI and more.Known fo
9 min read
Python Fundamentals
Python IntroductionPython was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation. It was designed with focus on code readability and its syntax allows us to express concepts in fewer lines of code.Key Features of PythonPythonâs simple and readable syntax makes it beginner-frien
3 min read
Input and Output in PythonUnderstanding input and output operations is fundamental to Python programming. With the print() function, we can display output in various formats, while the input() function enables interaction with users by gathering input during program execution. Taking input in PythonPython's input() function
7 min read
Python VariablesIn Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
6 min read
Python OperatorsIn Python programming, Operators in general are used to perform operations on values and variables. These are standard symbols used for logical and arithmetic operations. In this article, we will look into different types of Python operators. OPERATORS: These are the special symbols. Eg- + , * , /,
6 min read
Python KeywordsKeywords in Python are reserved words that have special meanings and serve specific purposes in the language syntax. Python keywords cannot be used as the names of variables, functions, and classes or any other identifier. Getting List of all Python keywordsWe can also get all the keyword names usin
2 min read
Python Data TypesPython Data types are the classification or categorization of data items. It represents the kind of value that tells what operations can be performed on a particular data. Since everything is an object in Python programming, Python data types are classes and variables are instances (objects) of thes
9 min read
Conditional Statements in PythonConditional statements in Python are used to execute certain blocks of code based on specific conditions. These statements help control the flow of a program, making it behave differently in different situations.If Conditional Statement in PythonIf statement is the simplest form of a conditional sta
6 min read
Loops in Python - For, While and Nested LoopsLoops in Python are used to repeat actions efficiently. The main types are For loops (counting through items) and While loops (based on conditions). In this article, we will look at Python loops and understand their working with the help of examples. For Loop in PythonFor loops is used to iterate ov
9 min read
Python FunctionsPython Functions is a block of statements that does a specific task. The idea is to put some commonly or repeatedly done task together and make a function so that instead of writing the same code again and again for different inputs, we can do the function calls to reuse code contained in it over an
9 min read
Recursion in PythonRecursion involves a function calling itself directly or indirectly to solve a problem by breaking it down into simpler and more manageable parts. In Python, recursion is widely used for tasks that can be divided into identical subtasks.In Python, a recursive function is defined like any other funct
6 min read
Python Lambda FunctionsPython Lambda Functions are anonymous functions means that the function is without a name. As we already know the def keyword is used to define a normal function in Python. Similarly, the lambda keyword is used to define an anonymous function in Python. In the example, we defined a lambda function(u
6 min read
Python Data Structures
Python StringA string is a sequence of characters. Python treats anything inside quotes as a string. This includes letters, numbers, and symbols. Python has no character data type so single character is a string of length 1.Pythons = "GfG" print(s[1]) # access 2nd char s1 = s + s[0] # update print(s1) # printOut
6 min read
Python ListsIn Python, a list is a built-in dynamic sized array (automatically grows and shrinks). We can store all types of items (including another list) in a list. A list may contain mixed type of items, this is possible because a list mainly stores references at contiguous locations and actual items maybe s
6 min read
Python TuplesA tuple in Python is an immutable ordered collection of elements. Tuples are similar to lists, but unlike lists, they cannot be changed after their creation (i.e., they are immutable). Tuples can hold elements of different data types. The main characteristics of tuples are being ordered , heterogene
6 min read
Dictionaries in PythonPython dictionary is a data structure that stores the value in key: value pairs. Values in a dictionary can be of any data type and can be duplicated, whereas keys can't be repeated and must be immutable. Example: Here, The data is stored in key:value pairs in dictionaries, which makes it easier to
7 min read
Python SetsPython set is an unordered collection of multiple items having different datatypes. In Python, sets are mutable, unindexed and do not contain duplicates. The order of elements in a set is not preserved and can change.Creating a Set in PythonIn Python, the most basic and efficient method for creating
10 min read
Python ArraysLists in Python are the most flexible and commonly used data structure for sequential storage. They are similar to arrays in other languages but with several key differences:Dynamic Typing: Python lists can hold elements of different types in the same list. We can have an integer, a string and even
9 min read
List Comprehension in PythonList comprehension is a way to create lists using a concise syntax. It allows us to generate a new list by applying an expression to each item in an existing iterable (such as a list or range). This helps us to write cleaner, more readable code compared to traditional looping techniques.For example,
4 min read
Advanced Python
Python OOPs ConceptsObject Oriented Programming is a fundamental concept in Python, empowering developers to build modular, maintainable, and scalable applications. OOPs is a way of organizing code that uses objects and classes to represent real-world entities and their behavior. In OOPs, object has attributes thing th
11 min read
Python Exception HandlingPython Exception Handling handles errors that occur during the execution of a program. Exception handling allows to respond to the error, instead of crashing the running program. It enables you to catch and manage errors, making your code more robust and user-friendly. Let's look at an example:Handl
6 min read
File Handling in PythonFile handling refers to the process of performing operations on a file, such as creating, opening, reading, writing and closing it through a programming interface. It involves managing the data flow between the program and the file system on the storage device, ensuring that data is handled safely a
4 min read
Python Database TutorialPython being a high-level language provides support for various databases. We can connect and run queries for a particular database using Python and without writing raw queries in the terminal or shell of that particular database, we just need to have that database installed in our system.A database
4 min read
Python MongoDB TutorialMongoDB is a popular NoSQL database designed to store and manage data flexibly and at scale. Unlike traditional relational databases that use tables and rows, MongoDB stores data as JSON-like documents using a format called BSON (Binary JSON). This document-oriented model makes it easy to handle com
2 min read
Python MySQLMySQL is a widely used open-source relational database for managing structured data. Integrating it with Python enables efficient data storage, retrieval and manipulation within applications. To work with MySQL in Python, we use MySQL Connector, a driver that enables seamless integration between the
9 min read
Python PackagesPython packages are a way to organize and structure code by grouping related modules into directories. A package is essentially a folder that contains an __init__.py file and one or more Python files (modules). This organization helps manage and reuse code effectively, especially in larger projects.
12 min read
Python ModulesPython Module is a file that contains built-in functions, classes,its and variables. There are many Python modules, each with its specific work.In this article, we will cover all about Python modules, such as How to create our own simple module, Import Python modules, From statements in Python, we c
7 min read
Python DSA LibrariesData Structures and Algorithms (DSA) serve as the backbone for efficient problem-solving and software development. Python, known for its simplicity and versatility, offers a plethora of libraries and packages that facilitate the implementation of various DSA concepts. In this article, we'll delve in
15 min read
List of Python GUI Library and PackagesGraphical User Interfaces (GUIs) play a pivotal role in enhancing user interaction and experience. Python, known for its simplicity and versatility, has evolved into a prominent choice for building GUI applications. With the advent of Python 3, developers have been equipped with lots of tools and li
11 min read
Data Science with Python
NumPy Tutorial - Python LibraryNumPy (short for Numerical Python ) is one of the most fundamental libraries in Python for scientific computing. It provides support for large, multi-dimensional arrays and matrices along with a collection of mathematical functions to operate on arrays.At its core it introduces the ndarray (n-dimens
3 min read
Pandas TutorialPandas is an open-source software library designed for data manipulation and analysis. It provides data structures like series and DataFrames to easily clean, transform and analyze large datasets and integrates with other Python libraries, such as NumPy and Matplotlib. It offers functions for data t
6 min read
Matplotlib TutorialMatplotlib is an open-source visualization library for the Python programming language, widely used for creating static, animated and interactive plots. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, Qt, GTK and wxPython. It
5 min read
Python Seaborn TutorialSeaborn is a library mostly used for statistical plotting in Python. It is built on top of Matplotlib and provides beautiful default styles and color palettes to make statistical plots more attractive.In this tutorial, we will learn about Python Seaborn from basics to advance using a huge dataset of
15+ min read
StatsModel Library- TutorialStatsmodels is a useful Python library for doing statistics and hypothesis testing. It provides tools for fitting various statistical models, performing tests and analyzing data. It is especially used for tasks in data science ,economics and other fields where understanding data is important. It is
4 min read
Learning Model Building in Scikit-learnBuilding machine learning models from scratch can be complex and time-consuming. Scikit-learn which is an open-source Python library which helps in making machine learning more accessible. It provides a straightforward, consistent interface for a variety of tasks like classification, regression, clu
8 min read
TensorFlow TutorialTensorFlow is an open-source machine-learning framework developed by Google. It is written in Python, making it accessible and easy to understand. It is designed to build and train machine learning (ML) and deep learning models. It is highly scalable for both research and production.It supports CPUs
2 min read
PyTorch TutorialPyTorch is an open-source deep learning framework designed to simplify the process of building neural networks and machine learning models. With its dynamic computation graph, PyTorch allows developers to modify the networkâs behavior in real-time, making it an excellent choice for both beginners an
7 min read
Web Development with Python
Flask TutorialFlask is a lightweight and powerful web framework for Python. Itâs often called a "micro-framework" because it provides the essentials for web development without unnecessary complexity. Unlike Django, which comes with built-in features like authentication and an admin panel, Flask keeps things mini
8 min read
Django Tutorial | Learn Django FrameworkDjango is a Python framework that simplifies web development by handling complex tasks for you. It follows the "Don't Repeat Yourself" (DRY) principle, promoting reusable components and making development faster. With built-in features like user authentication, database connections, and CRUD operati
10 min read
Django ORM - Inserting, Updating & Deleting DataDjango's Object-Relational Mapping (ORM) is one of the key features that simplifies interaction with the database. It allows developers to define their database schema in Python classes and manage data without writing raw SQL queries. The Django ORM bridges the gap between Python objects and databas
4 min read
Templating With Jinja2 in FlaskFlask is a lightweight WSGI framework that is built on Python programming. WSGI simply means Web Server Gateway Interface. Flask is widely used as a backend to develop a fully-fledged Website. And to make a sure website, templating is very important. Flask is supported by inbuilt template support na
6 min read
Django TemplatesTemplates are the third and most important part of Django's MVT Structure. A Django template is basically an HTML file that can also include CSS and JavaScript. The Django framework uses these templates to dynamically generate web pages that users interact with. Since Django primarily handles the ba
7 min read
Python | Build a REST API using FlaskPrerequisite: Introduction to Rest API REST stands for REpresentational State Transfer and is an architectural style used in modern web development. It defines a set or rules/constraints for a web application to send and receive data. In this article, we will build a REST API in Python using the Fla
3 min read
How to Create a basic API using Django Rest Framework ?Django REST Framework (DRF) is a powerful extension of Django that helps you build APIs quickly and easily. It simplifies exposing your Django models as RESTfulAPIs, which can be consumed by frontend apps, mobile clients or other services.Before creating an API, there are three main steps to underst
4 min read
Python Practice
Python QuizThese Python quiz questions are designed to help you become more familiar with Python and test your knowledge across various topics. From Python basics to advanced concepts, these topic-specific quizzes offer a comprehensive way to practice and assess your understanding of Python concepts. These Pyt
3 min read
Python Coding Practice ProblemsThis collection of Python coding practice problems is designed to help you improve your overall programming skills in Python.The links below lead to different topic pages, each containing coding problems, and this page also includes links to quizzes. You need to log in first to write your code. Your
1 min read
Python Interview Questions and AnswersPython is the most used language in top companies such as Intel, IBM, NASA, Pixar, Netflix, Facebook, JP Morgan Chase, Spotify and many more because of its simplicity and powerful libraries. To crack their Online Assessment and Interview Rounds as a Python developer, we need to master important Pyth
15+ min read