bergilfoyle / Alumni-Connect

A Web Application built using Docker, HTML/CSS/JS, Django and PostgreSQL. This portal is used by the college authorities to keep track of alumni and student details. The alumni may also post important resources and materials for the students.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run Docker command to initially start the project.
docker-compose up
New terminal to run commands.
docker exec -it dbdex_api_c bash
Run migrations to migrate tables to database.
python manage.py makemigrations
python manage.py migrate
To run python code.
python manage.py shell
To create groups for Admins and create one Admin.
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType

admins, _ = Group.objects.get_or_create(name='admins')
admins_ct = ContentType.objects.get(app_label='auth', model='user')
is_admin, _ = Permission.objects.get_or_create(name='is_admin', codename='is_admin', content_type=admins_ct)
admins.permissions.add(is_admin)
is_admin.save()
admin,_ = User.objects.get_or_create(username='admin')
admin.set_password('anteater')
admin.groups.add(admins)
admin.save()
admin.has_perm('auth.is_admin')
To create groups for Alumni.
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
alumni, _ = Group.objects.get_or_create(name='alumni')
alumni_ct, _ = ContentType.objects.get_or_create(app_label='auth', model='user')
is_alumnus, _ = Permission.objects.get_or_create(name='is_alumnus', codename='is_alumnus', content_type=alumni_ct)
alumni.permissions.add(is_alumnus)
To create groups for Students.
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
students, _ = Group.objects.get_or_create(name='students')
students_ct, _ = ContentType.objects.get_or_create(app_label='auth', model='User')
is_student, _ = Permission.objects.get_or_create(name='is_student', codename='is_student', content_type=students_ct)
students.permissions.add(is_student)
To delete a particular user.
from django.contrib.auth.models import User
User.objects.get(username='<username>').delete()

About

A Web Application built using Docker, HTML/CSS/JS, Django and PostgreSQL. This portal is used by the college authorities to keep track of alumni and student details. The alumni may also post important resources and materials for the students.


Languages

Language:HTML 50.9%Language:Python 46.5%Language:CSS 2.4%Language:Dockerfile 0.2%