Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added necessary libraries #26

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions CollegeERP/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'djoser',
'rest_framework.authtoken',
'apis',
'crispy_forms',

]

Expand Down Expand Up @@ -105,6 +106,7 @@
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},

]


Expand Down Expand Up @@ -138,3 +140,12 @@
'rest_framework.authentication.SessionAuthentication',
),
}

# Email Configuration
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'acpypjsfkzlpbqfz'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ A college management system built using Django framework. It is designed for int
## Installation

Python and Django need to be installed

Additional libraries should be imported as well
```bash
pip install django
pip install djangorestframework
pip install djoser
```

## Usage
Expand All @@ -23,7 +25,24 @@ Then go to the browser and enter the url **http://127.0.0.1:8000/**
## Login

The login page is common for students and teachers.
The username is their name and password for everyone is 'project123'.
The username is their name and password for everyone is 'project123'.


The student added will be given the credentials :

Username- Name

Password- USN



The teacher added will be given the credentials :

Username- Name

Password- Name



Example usernames:
student- 'samarth'
Expand Down Expand Up @@ -93,4 +112,4 @@ This will delete all present attendance data and create new attendance objects f

![alt text](https://imgur.com/tMKWx6f.png)

![alt text](https://imgur.com/PvCsNeB.png)
![alt text](https://imgur.com/PvCsNeB.png)
2 changes: 2 additions & 0 deletions apis/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.urls import path, include
import apis.views as api_view
from django.contrib import admin
from django.contrib.auth import views as auth_views
from . import views


urlpatterns = [
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
5 changes: 5 additions & 0 deletions info/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django import forms
from django.contrib.auth.models import User

class PasswordResetForm(forms.Form):
email= forms.CharField(max_length=100)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.1.2 on 2022-10-11 15:05

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('info', '0016_auto_20210820_1553'),
]

operations = [
migrations.RemoveField(
model_name='student',
name='DOB',
),
migrations.AddField(
model_name='student',
name='email',
field=models.EmailField(default='email', max_length=254),
),
migrations.AddField(
model_name='teacher',
name='email',
field=models.EmailField(default='email', max_length=254),
),
migrations.AlterField(
model_name='user',
name='first_name',
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
),
]
17 changes: 17 additions & 0 deletions info/migrations/0018_remove_teacher_email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.1.2 on 2022-10-11 15:06

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('info', '0017_remove_student_dob_student_email_teacher_email_and_more'),
]

operations = [
migrations.RemoveField(
model_name='teacher',
name='email',
),
]
2 changes: 1 addition & 1 deletion info/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Student(models.Model):
USN = models.CharField(primary_key='True', max_length=100)
name = models.CharField(max_length=200)
sex = models.CharField(max_length=50, choices=sex_choice, default='Male')
DOB = models.DateField(default='1998-01-01')
email = models.EmailField(default="email")

def __str__(self):
return self.name
Expand Down
Binary file added info/static/info/images/CE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added info/static/info/images/login.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 10 additions & 11 deletions info/templates/info/add_student.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,34 @@
<link href="{% static '/info/homepage/css/heroic-features.css' %}" rel="stylesheet">
<link href="{% static '/info/bootstrap/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">



<script src="https://kit.fontawesome.com/198ce549fd.js" crossorigin="anonymous"></script>
</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" style="background-color: black;">
<div class="container">
<a class="navbar-brand" href="{% url 'index' %}">CollegeERP</a>
<a class="navbar-brand" href="{% url 'index' %}" style="font-size: 30px;" ><i class="fa-sharp fa-solid fa-graduation-cap fa-2xl"></i> <span style="padding:2px 0px 2px 0px;">College ERP</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<!-- <div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
<button type="button" class="btn btn-outline-secondary btn-md"><a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal"></a></button>
</li>
</ul>
</div>
</div> -->
</div>
</nav>

<!-- Page Content -->
<div class="container">

<!-- Jumbotron Header -->
<header class="jumbotron my-4">
<h1 class="display-3 text-capitalize">Welcome {{ request.user }}</h1>
<header class="jumbotron my-4" style="background-color: rgba(0, 0, 0, 0.219);" >
<h1 class="text-center display-3 text-capitalize" style="font-family: 'Comic Neue', cursive; color: #060606;">Welcome {{ request.user }}</h1>
</header>

<!-- Page Features -->
Expand Down Expand Up @@ -101,9 +100,9 @@ <h3 class="mb-0">Student Information</h3>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label form-control-label">Date of Birth</label>
<label class="col-lg-3 col-form-label form-control-label">Email</label>
<div class="col-lg-9">
<input class="form-control" name="dob" type="date" required>
<input class="form-control" name="dob" type="email" required>
</div>
</div>

Expand Down
16 changes: 9 additions & 7 deletions info/templates/info/add_teacher.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,37 @@
<link href="{% static '/info/homepage/css/heroic-features.css' %}" rel="stylesheet">
<link href="{% static '/info/bootstrap/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">

<script src="https://kit.fontawesome.com/198ce549fd.js" crossorigin="anonymous"></script>



</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" style="background-color: black;">
<div class="container">
<a class="navbar-brand" href="{% url 'index' %}">CollegeERP</a>
<a class="navbar-brand" href="{% url 'index' %}" style="font-size: 30px;" ><i class="fa-sharp fa-solid fa-graduation-cap fa-2xl"></i> <span style="padding:2px 0px 2px 0px;">College ERP</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<!-- <div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
<button type="button" class="btn btn-outline-secondary btn-md"><a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal"></a></button>
</li>
</ul>
</div>
</div> -->
</div>
</nav>

<!-- Page Content -->
<div class="container">

<!-- Jumbotron Header -->
<header class="jumbotron my-4">
<h1 class="display-3 text-capitalize">Welcome {{ request.user }}</h1>
<header class="jumbotron my-4" style="background-color: rgba(0, 0, 0, 0.219);" >
<h1 class="text-center display-3 text-capitalize" style="font-family: 'Comic Neue', cursive; color: #060606;">Welcome {{ request.user }}</h1>
</header>

<!-- Page Features -->
Expand Down
14 changes: 8 additions & 6 deletions info/templates/info/admin_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
<!-- Custom styles for this template -->
<link href="{% static '/info/homepage/css/heroic-features.css' %}" rel="stylesheet">

<script src="https://kit.fontawesome.com/198ce549fd.js" crossorigin="anonymous"></script>

</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" style="background-color: black;">
<div class="container">
<a class="navbar-brand" href="{% url 'index' %}">CollegeERP</a>
<a class="navbar-brand" href="{% url 'index' %}" style="font-size: 30px;" ><i class="fa-sharp fa-solid fa-graduation-cap fa-2xl"></i> <span style="padding:2px 0px 2px 0px;">College ERP</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
<button type="button" class="btn btn-outline-secondary btn-md"><a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a></button>
</li>
</ul>
</div>
Expand All @@ -43,12 +45,12 @@
<div class="container">

<!-- Jumbotron Header -->
<header class="jumbotron my-4">
<h1 class="display-3 text-capitalize">Welcome {{ request.user }}</h1>
<header class="jumbotron my-4" style="background-color: rgba(0, 0, 0, 0.219);" >
<h1 class="text-center display-3 text-capitalize" style="font-family: 'Comic Neue', cursive; color: #060606;">Welcome {{ request.user }}</h1>
</header>

<!-- Page Features -->
<div class="row text-center justify-content-center">
<div class="row text-center justify-content-center display-flex">

<div class="col-lg-3 col-md-6 mb-4">
<div class="card">
Expand Down
53 changes: 53 additions & 0 deletions info/templates/info/forgot_password.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!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, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Forgot Password</title>

{% load static %}

<!-- Bootstrap core CSS-->
<link href="{% static '/info/bootstrap/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">

<!-- Custom fonts for this template-->
<link href="{% static '/info/bootstrap/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">

<!-- Custom styles for this template-->
<link href="{% static '/info/bootstrap/css/sb-admin.css' %}" rel="stylesheet">

</head>

<body class="bg-dark" style="background-image: url(https://images.unsplash.com/photo-1464802686167-b939a6910659?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aGlnaCUyMHJlc29sdXRpb24lMjAlMjBhYnN0cmFjdCUyMGltYWdlc3xlbnwwfHwwfHw%3D&auto=format&fit=crop&w=5000&q=60);max-height:50px; width: auto; background-repeat: no-repeat; background-size: cover;">

<div class="container" >
<div class="card card-login mx-auto mt-5">
<div class="card-header text-center" >Forgot Password</div>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button class="btn btn-success col-md-12 text-center" type="submit">Login</button> <br>

</form>

</div>
</div>
</div>

<!-- Bootstrap core JavaScript-->
<script src="{% static '/info/bootstrap/vendor/jquery/jquery.min.js' %}"></script>
<script src="{% static '/info/bootstrap/vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>

<!-- Core plugin JavaScript-->
<script src="{% static '/info/bootstrap/vendor/jquery-easing/jquery.easing.min.js' %}"></script>

</body>

</html>
10 changes: 6 additions & 4 deletions info/templates/info/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@

</head>

<body class="bg-dark">
<body class="bg-dark" style="background-image: url(https://images.unsplash.com/photo-1464802686167-b939a6910659?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aGlnaCUyMHJlc29sdXRpb24lMjAlMjBhYnN0cmFjdCUyMGltYWdlc3xlbnwwfHwwfHw%3D&auto=format&fit=crop&w=5000&q=60);max-height:50px; width: auto; background-repeat: no-repeat; background-size: cover;">

<div class="container">
<div class="container" >
<div class="card card-login mx-auto mt-5">
<div class="card-header">Login</div>
<div class="card-header text-center" >Login</div>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button class="btn btn-success" type="submit">Login</button>
<button class="btn btn-success col-md-12 text-center" type="submit">Login</button> <br>
<p><a href="{% url "password_reset" %}">Admin: Forgotten your password?</a></p>
<p><a href="{% url "forgot_password" %}">Student or Teacher: Forgotten your password?</a></p>
</form>

</div>
Expand Down
6 changes: 6 additions & 0 deletions info/templates/info/registration/password_reset_complete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends "index.html" %}
{% block title %}Password reset{% endblock %}
{% block content %}
<h1>Password set</h1>
<p>Your password has been set. You can <a href="{% url "login" %}">log in now</a></p>
{% endblock %}
16 changes: 16 additions & 0 deletions info/templates/info/registration/password_reset_confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "index.html" %}
{% block title %}Reset your password{% endblock %}
{% block content %}
<h1>Reset your password</h1>
{% if validlink %}
<p>Please enter your new password twice:</p>
<form action="." method="post">
{{ form.as_p }}
{% csrf_token %}
<p><input type="submit" value="Change my password" /></p>
</form>
{% else %}
<p>The password reset link was invalid, possibly because it has
already been used. Please request a new password reset.</p>
{% endif %}
{% endblock %}
Loading