diff --git a/.continueignore b/.continueignore new file mode 100644 index 0000000..bfe537e --- /dev/null +++ b/.continueignore @@ -0,0 +1,6 @@ +venv/ +.venv/ +__pycache__/ +.git/ +*.pyc +node_modules/ \ No newline at end of file diff --git a/core/settings.py b/core/settings.py index 0a33ac0..0802319 100644 --- a/core/settings.py +++ b/core/settings.py @@ -55,7 +55,9 @@ ROOT_URLCONF = 'core.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [ + os.path.join(BASE_DIR, 'templates'), + ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/core/urls.py b/core/urls.py index 3e9fe87..2abb81c 100644 --- a/core/urls.py +++ b/core/urls.py @@ -18,9 +18,12 @@ from django.conf import settings from django.contrib import admin from django.urls import path, include from django.conf.urls.static import static # <--- Добавьте эту строку +from . import views urlpatterns = [ path('admin/', admin.site.urls), + path('home/', views.home, name='home'), + path('about/', views.about, name='about'), path('', include('products.urls')), # Главная страница теперь ведет в products ] diff --git a/core/views.py b/core/views.py new file mode 100644 index 0000000..5881935 --- /dev/null +++ b/core/views.py @@ -0,0 +1,8 @@ +# core/views.py +from django.shortcuts import render + +def home(request): + return render(request, 'home.html') + +def about(request): + return render(request, 'about.html') \ No newline at end of file diff --git a/products/templates/products/list copy.html b/products/templates/products/list copy.html new file mode 100644 index 0000000..3b590ca --- /dev/null +++ b/products/templates/products/list copy.html @@ -0,0 +1,44 @@ + + + + + Мой Магазин + + + +
+

🚀 Система автоматизирована!

+

Этот билд был собран и развернут автоматически через Gitea Actions.

+ Время деплоя: 21.01.2026 + + +

+ ENV_TYPE: {{ env_type }} +

+
+ +

Список товаров

+ Перейти в панельку админа +
+ + {% for product in products %} +
+

{{ product.name }}

+

{{ product.description }}

+

Цена: {{ product.price }} руб.

+ {% if product.image %} + {{ product.name }} + {% else %} +

Нет изображения

+ {% endif %} +
+ {% empty %} +

Товаров пока нет.

+ {% endfor %} + + diff --git a/products/templates/products/list.html b/products/templates/products/list.html index 3b590ca..283c2bd 100644 --- a/products/templates/products/list.html +++ b/products/templates/products/list.html @@ -1,44 +1,29 @@ - - - - - Мой Магазин - - - -
-

🚀 Система автоматизирована!

-

Этот билд был собран и развернут автоматически через Gitea Actions.

- Время деплоя: 21.01.2026 + +{% extends 'base.html' %} - -

- ENV_TYPE: {{ env_type }} -

-
+{% block title %}Список продуктов{% endblock %} -

Список товаров

- Перейти в панельку админа -
- - {% for product in products %} -
-

{{ product.name }}

-

{{ product.description }}

-

Цена: {{ product.price }} руб.

- {% if product.image %} - {{ product.name }} - {% else %} -

Нет изображения

- {% endif %} +{% block content %} +
+
+

Список продуктов

+
+ {% for product in products %} +
+
+
+
{{ product.name }}
+

{{ product.description }}

+

Цена: {{ product.price }} руб.

+
+
+
+ {% empty %} +
+

Продуктов пока нет.

+
+ {% endfor %}
- {% empty %} -

Товаров пока нет.

- {% endfor %} - - +
+
+{% endblock %} \ No newline at end of file diff --git a/products/urls.py b/products/urls.py index dad2ee9..19b73b5 100644 --- a/products/urls.py +++ b/products/urls.py @@ -1,6 +1,7 @@ from django.urls import path from .views import product_list +app_name = 'products' # Это нужно добавить для регистрации пространства имён urlpatterns = [ - path('', product_list, name='product_list'), + path('', product_list, name='list'), ] \ No newline at end of file diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..dae36c5 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,13 @@ + +{% extends 'base.html' %} + +{% block title %}О нас{% endblock %} + +{% block content %} +
+
+

О нас

+

Это описание нашего проекта.

+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..9ea2fbd --- /dev/null +++ b/templates/base.html @@ -0,0 +1,28 @@ + + + + + + + {% block title %}Мой проект{% endblock %} + + + {% block extra_css %}{% endblock %} + + + + {% include 'components/navbar.html' %} + + +
+ {% block content %}{% endblock %} +
+ + + {% include 'components/footer.html' %} + + + + {% block extra_js %}{% endblock %} + + \ No newline at end of file diff --git a/templates/components/footer.html b/templates/components/footer.html new file mode 100644 index 0000000..8a8f37c --- /dev/null +++ b/templates/components/footer.html @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/templates/components/navbar.html b/templates/components/navbar.html new file mode 100644 index 0000000..6efb009 --- /dev/null +++ b/templates/components/navbar.html @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..87d12da --- /dev/null +++ b/templates/home.html @@ -0,0 +1,17 @@ + +{% extends 'base.html' %} + +{% block title %}Главная страница{% endblock %} + +{% block content %} +
+
+
+

Добро пожаловать!

+

Это главная страница нашего проекта.

+
+

Здесь можно разместить основную информацию о проекте.

+
+
+
+{% endblock %} \ No newline at end of file