diff --git a/CollegeERP/settings.py b/CollegeERP/settings.py index c8b4674..f0a213f 100644 --- a/CollegeERP/settings.py +++ b/CollegeERP/settings.py @@ -44,6 +44,7 @@ 'djoser', 'rest_framework.authtoken', 'apis', + 'crispy_forms', ] @@ -105,6 +106,7 @@ { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, + ] @@ -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 = 'programmingraw@gmail.com' +EMAIL_HOST_PASSWORD = 'acpypjsfkzlpbqfz' +EMAIL_USE_TLS = True +EMAIL_USE_SSL = False \ No newline at end of file diff --git a/README.md b/README.md index 1a1d668..9bb1750 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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' @@ -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) \ No newline at end of file diff --git a/apis/urls.py b/apis/urls.py index b3e6c4b..0275d04 100644 --- a/apis/urls.py +++ b/apis/urls.py @@ -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 = [ diff --git a/db.sqlite3 b/db.sqlite3 index ba905e0..abd32b1 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/info/forms.py b/info/forms.py new file mode 100644 index 0000000..2f58384 --- /dev/null +++ b/info/forms.py @@ -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) diff --git a/info/migrations/0017_remove_student_dob_student_email_teacher_email_and_more.py b/info/migrations/0017_remove_student_dob_student_email_teacher_email_and_more.py new file mode 100644 index 0000000..d596723 --- /dev/null +++ b/info/migrations/0017_remove_student_dob_student_email_teacher_email_and_more.py @@ -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'), + ), + ] diff --git a/info/migrations/0018_remove_teacher_email.py b/info/migrations/0018_remove_teacher_email.py new file mode 100644 index 0000000..57a763a --- /dev/null +++ b/info/migrations/0018_remove_teacher_email.py @@ -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', + ), + ] diff --git a/info/models.py b/info/models.py index 150ddd5..e546134 100644 --- a/info/models.py +++ b/info/models.py @@ -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 diff --git a/info/static/info/images/CE.png b/info/static/info/images/CE.png new file mode 100644 index 0000000..c76f4a2 Binary files /dev/null and b/info/static/info/images/CE.png differ diff --git a/info/static/info/images/login.jpg b/info/static/info/images/login.jpg new file mode 100644 index 0000000..47754d4 Binary files /dev/null and b/info/static/info/images/login.jpg differ diff --git a/info/templates/info/add_student.html b/info/templates/info/add_student.html index 1aa8416..c7130d6 100644 --- a/info/templates/info/add_student.html +++ b/info/templates/info/add_student.html @@ -19,26 +19,25 @@ - - +
-