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

Updating my repo #17

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions django-lms/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions django-lms/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn skillmate.wsgi
50 changes: 50 additions & 0 deletions django-lms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Handyskills - Transformative E-Learning for Africa


## Introduction
**Handyskills** is online training platform dedicated to trade skills in Africa, leveraging the power of Blockchain technology through NFT certificate minting.
Access high-quality, certified courses from experts that ensure total transparency and international recognition of your skills.
Join us in empowering the next generation of professionals and transforming careers across the continent, while mastering the future skills needed for Africa’s development in a dynamic and collaborative environment.


## Table of Content
* [Introduction](#introduction)
* [Installation](#installation)
* [Technologies Used](#technologies-used)
* [Features](#features)


## Installation
1. Clone the repository:
```

```
2. Navigate to the directory:
```

```
3. Install dependencies and run the server:
```
pip intall -r requirements.txt
```
python manage.py runserver
```
4. Open your web browser and go to http://localhost:8000.


## Technologies used
1. HTML
2. CSS
3. JavaScript
4. Python
5. Django


## Features
1. User authentication.
2. Course management system for teachers to create, manage and publish courses.
3. View course and enrollment statistics in Dashboard.
4. Course catalog with various categories.
5. Responsive design for mobile and tablet devices.
6. AI Chatbot

Binary file added django-lms/White Paper.docx
Binary file not shown.
Binary file added django-lms/data.json
Binary file not shown.
Binary file added django-lms/db.sqlite3
Binary file not shown.
Empty file added django-lms/main/__init__.py
Empty file.
Binary file added django-lms/main/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/forms.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/forms.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file added django-lms/main/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file added django-lms/main/__pycache__/views.cpython-39.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions django-lms/main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.contrib import admin

# Register your models here.

from .models import library, Course, Enrollment

admin.site.register(library)
admin.site.register(Course)
admin.site.register(Enrollment)
6 changes: 6 additions & 0 deletions django-lms/main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'main'
7 changes: 7 additions & 0 deletions django-lms/main/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms
from .models import Course

class CourseEditForm(forms.ModelForm):
class Meta:
model = Course
fields = ('title', 'description', 'thumbnail', 'featured_video', 'level', 'duration', 'category', 'requirements', 'content', 'lesson_title', 'lesson_video')
60 changes: 60 additions & 0 deletions django-lms/main/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Generated by Django 4.1.7 on 2024-10-16 21:25

import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('title', models.CharField(max_length=255)),
('slug', models.SlugField(unique=True)),
('description', models.TextField()),
('thumbnail', cloudinary.models.CloudinaryField(max_length=255, verbose_name='thumbnail')),
('featured_video', cloudinary.models.CloudinaryField(max_length=255, verbose_name='featured_video')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('level', models.CharField(choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], default='Beginner', max_length=20)),
('duration', models.CharField(default='0', max_length=10)),
('category', models.CharField(default='uncategorized', max_length=255)),
('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=8)),
('discount', models.DecimalField(decimal_places=2, default=0.0, max_digits=5)),
('requirements', models.TextField(default='', help_text='Enter the requirements for the course, separated by a comma.')),
('content', models.TextField(default='', help_text='Enter the course content, separated by a comma.')),
('lesson_title', models.CharField(default='Lesson', max_length=255)),
('lesson_video', cloudinary.models.CloudinaryField(max_length=255, null=True, verbose_name='lesson_video')),
('instructor', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='courses', to=settings.AUTH_USER_MODEL)),
('students', models.ManyToManyField(blank=True, related_name='enrolled_courses', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='library',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('description', models.CharField(max_length=255)),
('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
],
),
migrations.CreateModel(
name='Enrollment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('enrolled_at', models.DateTimeField(auto_now_add=True)),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.course')),
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrollments', to=settings.AUTH_USER_MODEL)),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.1.7 on 2024-10-16 21:33

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='course',
name='featured_video',
field=models.ImageField(upload_to='', verbose_name='featured_video'),
),
migrations.AlterField(
model_name='course',
name='thumbnail',
field=models.ImageField(upload_to='', verbose_name='thumbnail'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.1.7 on 2024-10-16 21:42

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0002_alter_course_featured_video_alter_course_thumbnail'),
]

operations = [
migrations.AlterField(
model_name='course',
name='featured_video',
field=models.ImageField(upload_to='static/img'),
),
migrations.AlterField(
model_name='course',
name='thumbnail',
field=models.ImageField(upload_to='static/img'),
),
]
18 changes: 18 additions & 0 deletions django-lms/main/migrations/0004_alter_course_lesson_video.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.7 on 2024-10-16 21:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0003_alter_course_featured_video_alter_course_thumbnail'),
]

operations = [
migrations.AlterField(
model_name='course',
name='lesson_video',
field=models.ImageField(null=True, upload_to='static/img'),
),
]
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
63 changes: 63 additions & 0 deletions django-lms/main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from django.db import models

from django.utils.text import slugify

from django.contrib.auth.models import User

class library(models.Model):
title = models.CharField(max_length=100)
description = models.CharField(max_length=255)

class Course(models.Model):
LEVEL_CHOICES = [
('Beginner', 'Beginner'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced')
]

id = models.AutoField(primary_key=True)
title = models.CharField(max_length=255)
slug = models.SlugField(unique=True)
description = models.TextField()
thumbnail = models.ImageField(upload_to="static/img")
featured_video = models.ImageField(upload_to="static/img")
instructor = models.ForeignKey(User, on_delete=models.CASCADE, related_name='courses', default=None)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
level = models.CharField(max_length=20, choices=LEVEL_CHOICES, default='Beginner')
duration = models.CharField(max_length=10, default='0')
category = models.CharField(max_length=255, default="uncategorized")
price = models.DecimalField(max_digits=8, decimal_places=2, default=0.00)
discount = models.DecimalField(max_digits=5, decimal_places=2, default=0.00)

requirements = models.TextField(help_text='Enter the requirements for the course, separated by a comma.', default='')
content = models.TextField(help_text='Enter the course content, separated by a comma.', default='')

lesson_title = models.CharField(max_length=255, default='Lesson')
lesson_video = models.ImageField(null=True, upload_to="static/img")

students = models.ManyToManyField(User, related_name='enrolled_courses', blank=True)

def __str__(self):
return self.title

def save(self, *args, **kwargs):
self.slug = slugify(self.title)
super().save(*args, **kwargs)

def get_instructor_username(self):
return self.instructor.username

def get_requirements_list(self):
return self.requirements.split(',')

def get_content_list(self):
return self.content.split(',')

class Enrollment(models.Model):
course = models.ForeignKey(Course, on_delete=models.CASCADE)
student = models.ForeignKey(User, on_delete=models.CASCADE, related_name='enrollments')
enrolled_at = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f'{self.student.username} enrolled in {self.course.title}'
3 changes: 3 additions & 0 deletions django-lms/main/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
18 changes: 18 additions & 0 deletions django-lms/main/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django.urls import path
from main import views

urlpatterns = [
path('', views.index, name='home'),
path('about/', views.about, name='about'),
path('contact/', views.contact, name='contact'),
path('courses/', views.courses, name='courses'),
path('dashboard/home/', views.dashboard_home, name='dashboard-home'),
path('dashboard/profile/', views.profile, name='profile'),
path('dashboard/courses-enrolled/', views.courses_enrolled, name='courses-enrolled'),
path('dashboard/courses-uploaded/', views.courses_uploaded, name='courses-uploaded'),
path('dashboard/upload/', views.upload, name='uploade'),
path('dashboard/<slug:slug>/course-edit/', views.course_edit, name='course-edit'),
path('dashboard/<slug:slug>/delete/', views.delete_course, name='delete-course'),
path('<str:instructor>/course/<slug:slug>/', views.course_details, name='course_details'),
path('courses/<str:category>/', views.category, name='category'),
]
Loading