Git Product home page Git Product logo

course-management-platform's Introduction

Course Management System

A Django-based web application designed for managing and participating in DataTalks.Club courses. This platform allows instructors to create and manage courses, assignments, and peer reviews.

Students can enroll in courses, submit homework, projects and engage in peer evaluations.

Features

  • User Authentication: Registration and login functionality for students and instructors.
  • Course Management: Instructors can create and manage courses.
  • Homework and Projects: Students can submit homework and projects; instructors can manage assignments.
  • Peer Reviews: Facilitates peer review process for project evaluations.
  • Leaderboard: Displays student rankings based on performance in courses.

Project Structure

├── accounts/ # Handles user accounts and authentication
├── course_management/ # Main project folder with settings and root configurations
├── courses/ # Main logic is here (courses, homeworks, etc)
├── templates/ # Global templates directory for the project

Running it locally

Installing dependencies

Install pipenv if you don't have it yet:

pip install pipenv

Install the dependencies (you need Python 3.9):

pipenv install

Activate virtual env:

pipenv shell

Prepare the service

Set the database to local:

export DATABASE_URL="sqlite:///db/db.sqlite3"

Make migrations:

make migrations
# python manage.py migrate

Add an admin user:

make admin
# python manage.py createsuperuser

Add some data:

make data

Running the service

make run
# python manage.py runserver 0.0.0.0:8000

Running with Docker

Build it:

docker build -t course_management .

Run it:

docker run -d \
    -p 8000:8000 \
    --name course_management \
    -e DATABASE_URL="sqlite:////data/db.sqlite3" \
    -v ${PWD}/db:/data \
    course_management

if you're on cygwin:

docker run -it --rm \
    -p 8000:8000 \
    --name course_management \
    -e DATABASE_URL="sqlite:////data/db.sqlite3" \
    -v `cygpath -w ${PWD}/db`:/data \
    course_management

remove the container later

docker rm course_management

get to the container

docker exec -it course_management bash

Authentication setup

If you want to authenticate with OAuth locally (not requeired for testing), do the following

  • Go to the admin panel (http://localhost:8000/admin)
  • Add a record to "Sites"
    • "localhost:8000" for display and domain names
    • note the ID of the site (probably it's "2")
  • Add records to "Social applications":
    • GoogleDTC. Provider: Google
    • Ask Alexey for the keys. Don't share them publicly
    • For the site, choose the localhost one

Export SITE_ID (should be the ID of the localhost site):

export SITE_ID=2

Restart the app:

python manage.py runserver 0.0.0.0:8000

Now log out as admin and log in with Google

DB connection

Prep work

Host bastion-tunnel
    HostName <IP>
    User ubuntu
    IdentityFile c:/Users/alexe/.ssh/<KEY>.pem
    LocalForward 5433 dev-course-management-cluster.cluster-cpj5uw8ck6vb.eu-west-1.rds.amazonaws.com:5432
    ServerAliveInterval 60

Connect to the bastion

ssh bastion-tunnel

And then

pgcli -h localhost -p 5433 -u pgusr -d coursemanagement

When connecting for the first time, create dev and prod schemas

CREATE DATABASE dev;
CREATE DATABASE prod;

Django shell

export DATABASE_URL="postgresql://pgusr:${DB_PASSWORD}@localhost:5433/dev"
export SECRET_KEY="${DJANGO_SECRET}"

pipenv run python manage.py shell

or

export DATABASE_URL="postgresql://pgusr:${DB_PASSWORD}@localhost:5433/prod"
export SECRET_KEY="${DJANGO_SECRET}"

Finding user with email:

from django.contrib.auth import get_user_model
User = get_user_model()

user = User.objects.get(email='[email protected]')

Getting the data

There are /data endpoints for getting the data

Using them:

TOKEN="TOKEN"
HOST="http://localhost:8000"
COURSE="fake-course"
HOMEWORK="hw1"

curl \
    -H "Authorization: ${TOKEN}" \
    "${HOST}/data/${COURSE}/homework/${HOMEWORK}"

course-management-platform's People

Contributors

alexeygrigorev avatar bhimrazy avatar m97chahboun avatar mostafanasser2000 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.