diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/.gitignore" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/.gitignore" new file mode 100644 index 000000000..b8399a7c4 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/.gitignore" @@ -0,0 +1,2 @@ +**/__pycache__ +db.sqlite3 diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/__init__.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/__init__.py" new file mode 100644 index 000000000..e69de29bb diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/asgi.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/asgi.py" new file mode 100644 index 000000000..184ec66c3 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/asgi.py" @@ -0,0 +1,16 @@ +""" +ASGI config for lab78 project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab78.settings') + +application = get_asgi_application() diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/settings.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/settings.py" new file mode 100644 index 000000000..4f3cfcaf1 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/settings.py" @@ -0,0 +1,128 @@ +""" +Django settings for lab78 project. + +Generated by 'django-admin startproject' using Django 5.1.2. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-&7s8wt$(r#%ag6l2gh+@(o4(8pg_^7(c!vo+_a%kzdz(i!i073' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'main', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'lab78.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'lab78.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + BASE_DIR / "main/static", # Папка статических файлов +] + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/urls.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/urls.py" new file mode 100644 index 000000000..9a236b503 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/urls.py" @@ -0,0 +1,28 @@ +""" +URL configuration for lab78 project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('main.urls')), +] + +if settings.DEBUG: + urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/wsgi.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/wsgi.py" new file mode 100644 index 000000000..9d775200a --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/lab78/wsgi.py" @@ -0,0 +1,16 @@ +""" +WSGI config for lab78 project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab78.settings') + +application = get_wsgi_application() diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/__init__.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/__init__.py" new file mode 100644 index 000000000..e69de29bb diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/admin.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/admin.py" new file mode 100644 index 000000000..81e703014 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/admin.py" @@ -0,0 +1,4 @@ +from django.contrib import admin +from .models import ContactMessage + +admin.site.register(ContactMessage) \ No newline at end of file diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/apps.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/apps.py" new file mode 100644 index 000000000..167f04426 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/apps.py" @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'main' diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/forms.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/forms.py" new file mode 100644 index 000000000..bae81fa59 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/forms.py" @@ -0,0 +1,23 @@ +from django import forms + +class ContactForm(forms.Form): + name = forms.CharField( + max_length=100, + label='Ваше имя', + widget=forms.TextInput(attrs={ + 'class': 'w-full p-2 border rounded', + }) + ) + email = forms.EmailField( + label='Ваш email', + widget=forms.EmailInput(attrs={ + 'class': 'w-full p-2 border rounded', + }) + ) + message = forms.CharField( + label='Сообщение', + widget=forms.Textarea(attrs={ + 'class': 'w-full p-2 border rounded', + 'rows': 5, + }) + ) diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/migrations/0001_initial.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/migrations/0001_initial.py" new file mode 100644 index 000000000..eccceb5cd --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/migrations/0001_initial.py" @@ -0,0 +1,24 @@ +# Generated by Django 5.1.2 on 2025-04-27 06:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='ContactMessage', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('email', models.EmailField(max_length=254)), + ('message', models.TextField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/migrations/__init__.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/migrations/__init__.py" new file mode 100644 index 000000000..e69de29bb diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/models.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/models.py" new file mode 100644 index 000000000..8b384b95d --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/models.py" @@ -0,0 +1,10 @@ +from django.db import models + +class ContactMessage(models.Model): + name = models.CharField(max_length=100) + email = models.EmailField() + message = models.TextField() + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Сообщение от {self.name} ({self.email})" diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/background.jpg" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/background.jpg" new file mode 100644 index 000000000..ff28e76d7 Binary files /dev/null and "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/background.jpg" differ diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/style.css" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/style.css" new file mode 100644 index 000000000..407a34a52 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/static/main/style.css" @@ -0,0 +1,176 @@ +body { + background-color: grey; /* Черный фон на случай если картинка не загрузится */ +} + +.background-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-size: cover; + background-position: center; + background-attachment: fixed; + z-index: 0; + opacity: 0.7; /* Чуть затемним */ +} +/* Новый стиль для заголовка с более светлым фоном */ +.hero-title { + font-size: 4rem; + font-weight: bold; + text-align: center; + background: white; /* Светлый градиент */ + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; /* Для WebKit-браузеров */ + margin-top: 3rem; + margin-bottom: 2rem; + text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3); /* Мягкая тень */ + animation: textEffect 2s ease forwards, slideIn 1.5s ease-out forwards; + opacity: 0; +} + +@keyframes textEffect { + 0% { + transform: scale(0.9); + opacity: 0; + } + 50% { + transform: scale(1.1); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 1; + } +} + +@keyframes slideIn { + 0% { + opacity: 0; + transform: translateY(-50px); + } + 100% { + opacity: 1; + transform: translateY(0); + } +} + +/* Карточка */ +.card { + background-color: #2d2d2d; /* темная карточка */ + border-radius: 10px; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* мягкая тень */ + padding: 2rem; + transition: box-shadow 0.3s ease; +} + +.card:hover { + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); /* тень на карточке при наведении */ +} + +/* Ссылки и кнопки */ +a, button { + background-color: #201c1c; + color: white; + padding: 0.8rem 2rem; + border-radius: 5px; + text-decoration: none; + font-weight: bold; + transition: all 0.3s ease; +} + +a:hover, button:hover { + background-color: #3a2d2d; /* темнее при наведении */ + transform: scale(1.05); +} + +/* Навигация */ +.header { + background: #201c1c; /* бордовый градиент для шапки */ + color: white; + padding: 1rem 0; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + position: sticky; + top: 0; + z-index: 50; +} + +/* Навигация (ссылки) */ +.navbar { + display: flex; + justify-content: space-between; + align-items: center; + max-width: 1200px; + margin: 0 auto; + padding: 0 2rem; +} + +.navbar a { + margin-left: 1.5rem; + font-weight: bold; + text-decoration: none; + color: white; + transition: color 0.3s ease, transform 0.3s ease; +} + +.navbar a:hover { + color: #f3f4f6; /* светлый оттенок при наведении */ + transform: translateY(-2px); +} + +/* Логотип */ +.logo { + font-size: 1.8rem; + font-weight: bold; + letter-spacing: 1px; +} + +/* Футер */ +footer { + background-color: #696969; + color: #d4d4d4; + text-align: center; + padding: 1.5rem; + margin-top: 3rem; +} + +/* Бордовый цвет */ +.bg-burgundy { + background-color: #201c1c; +} + +.bg-burgundy-dark { + background-color: #201c1c; +} + +/* Темные тени */ +.shadow-card { + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); +} + +/* Эффект кнопки */ +.button-hover { + transition: transform 0.3s ease, background-color 0.3s ease; +} + +.button-hover:hover { + transform: scale(1.05); + background-color: #201c1c;; /* темнее при наведении */ +} + +.card input, .card textarea, .card label { + color: white; +} + + +.card input, .card textarea { + background-color: #3a3a3a; /* тёмно-серый фон полей */ + border: 1px solid #555; /* серые рамки */ + padding: 0.5rem; + border-radius: 5px; +} + +.card input::placeholder, .card textarea::placeholder { + color: #ccc; /* светлый текст для подсказок */ +} \ No newline at end of file diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/about.html" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/about.html" new file mode 100644 index 000000000..545ff48d6 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/about.html" @@ -0,0 +1,20 @@ +{% extends 'main/base.html' %} + +{% block title %}О разработке{% endblock %} + +{% block content %} +
+

О разработке проекта

+ +
+

Использованные инструменты

+ +
+
+{% endblock %} diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/base.html" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/base.html" new file mode 100644 index 000000000..cf7392148 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/base.html" @@ -0,0 +1,35 @@ +{% load static %} + + + + + {% block title %}Lab 7-8{% endblock %} + + + + + +
+ +
+ +
+ +
+ {% block content %} + {% endblock %} +
+ + + + + diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/contact.html" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/contact.html" new file mode 100644 index 000000000..7b7cc6440 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/contact.html" @@ -0,0 +1,39 @@ +{% extends 'main/base.html' %} + +{% block title %}Обратная связь{% endblock %} + +{% block content %} +
+

Свяжитесь с нами

+ +
+ {% csrf_token %} + + +
+ + {{ form.name }} +
+ + +
+ + {{ form.email }} +
+ + +
+ + {{ form.message }} +
+ + +
+ + {% if success %} +

Спасибо за ваше сообщение!

+ {% endif %} +
+{% endblock %} diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/home.html" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/home.html" new file mode 100644 index 000000000..f57622158 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/templates/main/home.html" @@ -0,0 +1,10 @@ +{% extends 'main/base.html' %} + +{% block title %}Главная страница{% endblock %} + +{% block content %} +
+

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

+

Этот сайт создан в рамках лабораторной работы 7-8 по Django.

+
+{% endblock %} diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/tests.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/tests.py" new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/tests.py" @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/urls.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/urls.py" new file mode 100644 index 000000000..e48d57d51 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/urls.py" @@ -0,0 +1,8 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.home, name='home'), + path('about/', views.about, name='about'), + path('contact/', views.contact, name='contact'), +] diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/views.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/views.py" new file mode 100644 index 000000000..16f646687 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/main/views.py" @@ -0,0 +1,27 @@ +from django.shortcuts import render +from .forms import ContactForm +from .models import ContactMessage + +def home(request): + return render(request, 'main/home.html') + +def about(request): + return render(request, 'main/about.html') + +def contact(request): + success = False + if request.method == 'POST': + form = ContactForm(request.POST) + if form.is_valid(): + # Сохраняем данные формы в базу + ContactMessage.objects.create( + name=form.cleaned_data['name'], + email=form.cleaned_data['email'], + message=form.cleaned_data['message'] + ) + success = True + form = ContactForm() # Очищаем форму после отправки + else: + form = ContactForm() + + return render(request, 'main/contact.html', {'form': form, 'success': success}) diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/manage.py" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/manage.py" new file mode 100644 index 000000000..e387a4c61 --- /dev/null +++ "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/manage.py" @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab78.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git "a/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/\320\236\321\202\321\207\320\265\321\202_\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217.odt" "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/\320\236\321\202\321\207\320\265\321\202_\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217.odt" new file mode 100644 index 000000000..afbff5de1 Binary files /dev/null and "b/works/\320\2323323/\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217/lab78/\320\236\321\202\321\207\320\265\321\202_\320\237\320\265\321\202\321\200\320\276\320\262\320\260_\320\222\320\270\320\272\321\202\320\276\321\200\320\270\321\217.odt" differ