Compare commits

...

1 Commits

Author SHA1 Message Date
Flatlogic Bot
9ce0135bc0 v1 2025-10-29 00:35:09 +00:00
22 changed files with 339 additions and 207 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -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()

View File

@ -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')

View File

@ -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.'))

View File

@ -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')),
],
),
]

View File

@ -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

View File

@ -1,11 +1,35 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8">
<title>{% block title %}Knowledge Base{% endblock %}</title>
{% block head %}{% endblock %}
</head>
<body>
{% block content %}{% endblock %}
</body>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My App</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="{% static 'css/custom.css' %}">
</head>
<body class="dark-mode">
<div class="container">
<header class="d-flex justify-content-between align-items-center py-4">
<a href="/" class="logo">My App</a>
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
</header>
<main>
{% block content %}
{% endblock %}
</main>
<footer class="text-center py-4">
<p>&copy; 2025 My App. All rights reserved.</p>
</footer>
</div>
</body>
</html>

View File

@ -1,154 +1,21 @@
{% extends "base.html" %}
{% block title %}{{ project_name }}{% endblock %}
{% block head %}
{% if project_description %}
<meta name="description" content="{{ project_description }}">
<meta property="og:description" content="{{ project_description }}">
<meta property="twitter:description" content="{{ project_description }}">
{% endif %}
{% if project_image_url %}
<meta property="og:image" content="{{ project_image_url }}">
<meta property="twitter:image" content="{{ project_image_url }}">
{% endif %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
: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);
}
* {
box-sizing: border-box;
}
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;
}
body::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% {
background-position: 0% 0%;
}
100% {
background-position: 100% 100%;
}
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2.5rem 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
h1 {
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
font-weight: 700;
margin: 0 0 1.2rem;
letter-spacing: -0.02em;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
opacity: 0.92;
}
.loader {
margin: 1.5rem auto;
width: 56px;
height: 56px;
border: 4px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.runtime code {
background: rgba(0, 0, 0, 0.25);
padding: 0.15rem 0.45rem;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
footer {
position: absolute;
bottom: 1rem;
width: 100%;
text-align: center;
font-size: 0.85rem;
opacity: 0.75;
}
</style>
{% endblock %}
{% extends 'base.html' %}
{% block content %}
<main>
<div class="card">
<h1>Analyzing your requirements and generating your app…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<div class="container mt-5">
<div class="row">
<div class="col-md-8 offset-md-2">
<h1 class="mb-4">Knowledge Base</h1>
{% for article in articles %}
<div class="card mb-3">
<div class="card-body">
<h2 class="card-title"><a href="#">{{ article.title }}</a></h2>
<p class="card-text">{{ article.content|truncatewords:50 }}</p>
<p class="card-text"><small class="text-muted">Published on {{ article.created_at|date:"F d, Y" }} by {{ article.author }}</small></p>
</div>
</div>
{% empty %}
<p>No articles found.</p>
{% endfor %}
</div>
</div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
</p>
</div>
</main>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
</footer>
</div>
{% endblock %}

View File

@ -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'),
]

View File

@ -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})

85
static/css/custom.css Normal file
View File

@ -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;
}

View File

@ -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;
}