diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..2cbf23b 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..fd08fef 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..69446af 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..dbd739e 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..7ff3760 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import Instructor, Course -# Register your models here. +admin.site.register(Instructor) +admin.site.register(Course) \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..74f256e --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,33 @@ +# Generated by Django 5.2.7 on 2025-10-27 15:27 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Instructor', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('bio', models.TextField()), + ], + ), + migrations.CreateModel( + name='Course', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('description', models.TextField()), + ('price', models.DecimalField(decimal_places=2, max_digits=10)), + ('instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='courses', to='core.instructor')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..fb87921 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..3d815fe 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,17 @@ from django.db import models -# Create your models here. +class Instructor(models.Model): + name = models.CharField(max_length=100) + bio = models.TextField() + + def __str__(self): + return self.name + +class Course(models.Model): + title = models.CharField(max_length=200) + description = models.TextField() + instructor = models.ForeignKey(Instructor, on_delete=models.CASCADE, related_name='courses') + price = models.DecimalField(max_digits=10, decimal_places=2) + + def __str__(self): + return self.title \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 788576e..aa36707 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,11 +1,35 @@ - + - {% block title %}Knowledge Base{% endblock %} - {% block head %}{% endblock %} - - - {% block content %}{% endblock %} - - + + {% block title %}Course Catalog{% endblock %} + + {% load static %} + + + + + +
+ {% block content %} + {% endblock %} +
+ + + + \ No newline at end of file diff --git a/core/templates/core/course_detail.html b/core/templates/core/course_detail.html new file mode 100644 index 0000000..6f65731 --- /dev/null +++ b/core/templates/core/course_detail.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} + +{% block title %}{{ course.title }}{% endblock %} + +{% block content %} +
+
+
+

{{ course.title }}

+

by {{ course.instructor.name }}

+
+

{{ course.description }}

+
+
+
+
+
Course Details
+

Price: ${{ course.price }}

+ Add to Wishlist + Enroll Now +
+
+
+
+
+{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 0a3f404..291843a 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,154 +1,34 @@ -{% extends "base.html" %} +{% extends 'base.html' %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} -{% if project_description %} - - - -{% endif %} -{% if project_image_url %} - - -{% endif %} - - - - -{% endblock %} +{% block title %}Course Catalog{% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+

Welcome to Our Course Catalog

+

Find the perfect course to kickstart your learning journey.

-

AppWizzy AI is collecting your requirements and applying the first changes.

-

This page will refresh automatically as the plan is implemented.

-

- Runtime: Django {{ django_version }} · Python {{ python_version }} - — UTC {{ current_time|date:"Y-m-d H:i:s" }} -

-
-
- -{% endblock %} \ No newline at end of file + + +
+ {% for course in courses %} +
+
+
+
{{ course.title }}
+
{{ course.instructor.name }}
+

{{ course.description|truncatewords:20 }}

+ View Details +
+ +
+
+ {% empty %} +
+

No courses available at the moment.

+
+ {% endfor %} +
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..2b2022b 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,7 @@ from django.urls import path - -from .views import home +from . import views urlpatterns = [ - path("", home, name="home"), -] + path('', views.course_list, name='course_list'), + path('course//', views.course_detail, name='course_detail'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..231935c 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,10 @@ -import os -import platform +from django.shortcuts import render, get_object_or_404 +from .models import Course -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone +def course_list(request): + courses = Course.objects.all() + return render(request, 'core/index.html', {'courses': courses}) - -def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() - - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) +def course_detail(request, pk): + course = get_object_or_404(Course, pk=pk) + return render(request, 'core/course_detail.html', {'course': course}) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..681ab64 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,19 @@ +body { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + font-family: Georgia, serif; +} + +.hero-section { + background-color: #f8f9fa; +} + +.card { + transition: transform .2s; +} + +.card:hover { + transform: scale(1.05); +}