diff --git a/assets/pasted-20251029-002142-3359b288.png b/assets/pasted-20251029-002142-3359b288.png new file mode 100644 index 0000000..f0faf7d Binary files /dev/null and b/assets/pasted-20251029-002142-3359b288.png differ diff --git a/assets/pasted-20251029-002338-2cd3d3b2.png b/assets/pasted-20251029-002338-2cd3d3b2.png new file mode 100644 index 0000000..87d0c90 Binary files /dev/null and b/assets/pasted-20251029-002338-2cd3d3b2.png differ diff --git a/assets/pasted-20251029-003217-94e2da6f.png b/assets/pasted-20251029-003217-94e2da6f.png new file mode 100644 index 0000000..e63eb1b Binary files /dev/null and b/assets/pasted-20251029-003217-94e2da6f.png differ diff --git a/assets/vm-shot-2025-10-29T00-20-57-673Z.jpg b/assets/vm-shot-2025-10-29T00-20-57-673Z.jpg new file mode 100644 index 0000000..9c1042b Binary files /dev/null and b/assets/vm-shot-2025-10-29T00-20-57-673Z.jpg differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 139db10..aeaeaf4 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/urls.py b/config/urls.py index 5093d47..061dcf7 100644 --- a/config/urls.py +++ b/config/urls.py @@ -16,8 +16,14 @@ Including another URLconf """ from django.contrib import admin from django.urls import include, path +from django.conf import settings +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.conf.urls.static import static urlpatterns = [ path("admin/", admin.site.urls), path("", include("core.urls")), ] + +if settings.DEBUG: + urlpatterns += staticfiles_urlpatterns() diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..c04c091 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..2cdbd65 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..3e116ea 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..17db810 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..a756890 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,15 @@ from django.contrib import admin +from .models import Category, Article -# Register your models here. + +@admin.register(Category) +class CategoryAdmin(admin.ModelAdmin): + list_display = ('name', 'slug') + prepopulated_fields = {'slug': ('name',)} + + +@admin.register(Article) +class ArticleAdmin(admin.ModelAdmin): + list_display = ('title', 'category', 'author', 'created_at') + list_filter = ('category', 'author') + search_fields = ('title', 'content') \ No newline at end of file diff --git a/core/management/commands/__pycache__/populate_db.cpython-311.pyc b/core/management/commands/__pycache__/populate_db.cpython-311.pyc new file mode 100644 index 0000000..b24b4ca Binary files /dev/null and b/core/management/commands/__pycache__/populate_db.cpython-311.pyc differ diff --git a/core/management/commands/populate_db.py b/core/management/commands/populate_db.py new file mode 100644 index 0000000..4a17c8f --- /dev/null +++ b/core/management/commands/populate_db.py @@ -0,0 +1,38 @@ +from django.core.management.base import BaseCommand +from django.contrib.auth.models import User +from core.models import Category, Article + +class Command(BaseCommand): + help = 'Populates the database with sample data' + + def handle(self, *args, **options): + self.stdout.write('Deleting existing data...') + Article.objects.all().delete() + Category.objects.all().delete() + User.objects.filter(is_superuser=False).delete() + + self.stdout.write('Creating new data...') + + # Create users + editor_user = User.objects.create_user(username='editor', password='password') + + # Create categories + general_cat = Category.objects.create(name='General', slug='general') + tech_cat = Category.objects.create(name='Technical', slug='technical') + + # Create articles + Article.objects.create( + title='Getting Started with Django', + content='This is a beginner-friendly guide to start your journey with the Django framework.', + category=tech_cat, + author=editor_user + ) + + Article.objects.create( + title='Our Company Policy', + content='An overview of our company policies and guidelines for all employees.', + category=general_cat, + author=editor_user + ) + + self.stdout.write(self.style.SUCCESS('Successfully populated the database.')) diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..262fdfe --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,37 @@ +# Generated by Django 5.2.7 on 2025-10-29 00:16 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100, unique=True)), + ('slug', models.SlugField(max_length=100, unique=True)), + ], + ), + migrations.CreateModel( + name='Article', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('content', models.TextField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to=settings.AUTH_USER_MODEL)), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to='core.category')), + ], + ), + ] 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..5323418 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..efba32c 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,22 @@ from django.db import models +from django.contrib.auth.models import User -# Create your models here. + +class Category(models.Model): + name = models.CharField(max_length=100, unique=True) + slug = models.SlugField(max_length=100, unique=True) + + def __str__(self): + return self.name + + +class Article(models.Model): + title = models.CharField(max_length=200) + content = models.TextField() + category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='articles') + author = models.ForeignKey(User, on_delete=models.CASCADE, related_name='articles') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + 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..9cc8059 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,11 +1,35 @@ +{% load static %} - + - {% block title %}Knowledge Base{% endblock %} - {% block head %}{% endblock %} - - - {% block content %}{% endblock %} - - + + My App + + + + + + + +
+
+ + +
+ +
+ {% block content %} + {% endblock %} +
+ + +
+ + \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 0a3f404..6ae9418 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,154 +1,21 @@ -{% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} -{% if project_description %} - - - -{% endif %} -{% if project_image_url %} - - -{% endif %} - - - - -{% endblock %} - +{% extends 'base.html' %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+
+

Knowledge Base

+ {% for article in articles %} +
+
+

{{ article.title }}

+

{{ article.content|truncatewords:50 }}

+

Published on {{ article.created_at|date:"F d, Y" }} by {{ article.author }}

+
+
+ {% empty %} +

No articles found.

+ {% endfor %} +
-

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 + +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..c486297 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,6 @@ from django.urls import path - -from .views import home +from . import views urlpatterns = [ - path("", home, name="home"), -] + path('', views.index, name='index'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..19725b4 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,6 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render -from django.utils import timezone +from .models import Article - -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 index(request): + articles = Article.objects.order_by('-created_at') + return render(request, 'core/index.html', {'articles': articles}) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..ed6a6e7 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,85 @@ +body { + font-family: 'Inter', sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +body.dark-mode { + background-color: #0D1117; + color: #C9D1D9; +} + +.container { + max-width: 960px; +} + +.dark-mode a { + color: #22d3ee; + text-decoration: none; + transition: color 0.2s ease-in-out; +} + +.dark-mode a:hover { + color: #5eead4; + text-decoration: none; +} + +.dark-mode header .logo { + font-size: 1.5rem; + font-weight: 700; + color: #FFFFFF; +} + +.dark-mode header nav a { + margin-left: 2rem; + font-weight: 500; + color: #C9D1D9; +} + +.dark-mode .card { + background-color: #161B22; + border: 1px solid #30363D; + border-radius: 0.5rem; + padding: 2rem; + margin-bottom: 2rem; +} + +.dark-mode .card-title { + color: #FFFFFF; + font-size: 1.5rem; + font-weight: 700; + margin-bottom: 1rem; +} + +.dark-mode .card-text { + color: #C9D1D9; + line-height: 1.6; +} + +.dark-mode footer { + border-top: 1px solid #30363D; + margin-top: 4rem; +} + +.dark-mode footer p { + color: #C9D1D9; + margin: 0; +} + +/* Article Detail */ +.dark-mode .article-title { + font-size: 2.5rem; + font-weight: 700; + color: #FFFFFF; + margin-bottom: 1rem; +} + +.dark-mode .article-meta { + color: #8B949E; + margin-bottom: 2rem; +} + +.dark-mode .article-content { + line-height: 1.8; + font-size: 1.1rem; +} diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..ed6a6e7 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,85 @@ - -:root { - --bg-color-start: #6a11cb; - --bg-color-end: #2575fc; - --text-color: #ffffff; - --card-bg-color: rgba(255, 255, 255, 0.01); - --card-border-color: rgba(255, 255, 255, 0.1); -} body { - margin: 0; font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); - color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +body.dark-mode { + background-color: #0D1117; + color: #C9D1D9; +} + +.container { + max-width: 960px; +} + +.dark-mode a { + color: #22d3ee; + text-decoration: none; + transition: color 0.2s ease-in-out; +} + +.dark-mode a:hover { + color: #5eead4; + text-decoration: none; +} + +.dark-mode header .logo { + font-size: 1.5rem; + font-weight: 700; + color: #FFFFFF; +} + +.dark-mode header nav a { + margin-left: 2rem; + font-weight: 500; + color: #C9D1D9; +} + +.dark-mode .card { + background-color: #161B22; + border: 1px solid #30363D; + border-radius: 0.5rem; + padding: 2rem; + margin-bottom: 2rem; +} + +.dark-mode .card-title { + color: #FFFFFF; + font-size: 1.5rem; + font-weight: 700; + margin-bottom: 1rem; +} + +.dark-mode .card-text { + color: #C9D1D9; + line-height: 1.6; +} + +.dark-mode footer { + border-top: 1px solid #30363D; + margin-top: 4rem; +} + +.dark-mode footer p { + color: #C9D1D9; + margin: 0; +} + +/* Article Detail */ +.dark-mode .article-title { + font-size: 2.5rem; + font-weight: 700; + color: #FFFFFF; + margin-bottom: 1rem; +} + +.dark-mode .article-meta { + color: #8B949E; + margin-bottom: 2rem; +} + +.dark-mode .article-content { + line-height: 1.8; + font-size: 1.1rem; }