From 4dee6de30cf37c7f794e079e6015efc216eacbaa Mon Sep 17 00:00:00 2001 From: krasi Date: Wed, 8 May 2024 19:21:13 +0300 Subject: [PATCH] NASA-TEST --- Nasa-TEST/Dockerfile | 14 +++++++ Nasa-TEST/docker-compose.yml | 29 ++++++++++++++ Nasa-TEST/init.sql | 0 Nasa-TEST/main/urls.py | 6 +++ Nasa-TEST/staticfiles/css/custom.css | 50 ++++++++++++++++++++++++ Nasa-TEST/templates/caruserl.html | 27 +++++++++++++ Nasa-TEST/templates/css.html | 8 ++++ Nasa-TEST/templates/headers.html | 8 ++++ Nasa-TEST/templates/index.html | 18 +++++++++ Nasa-TEST/templates/nav.html | 30 ++++++++++++++ Nasa-TEST/templates/script.html | 39 +++++++++++++++++++ Nasa-TEST/templates/seo.html | 6 +++ Nasa-TEST/templates/welcome.html | 58 ++++++++++++++++++++++++++++ 13 files changed, 293 insertions(+) create mode 100644 Nasa-TEST/Dockerfile create mode 100644 Nasa-TEST/docker-compose.yml create mode 100644 Nasa-TEST/init.sql create mode 100644 Nasa-TEST/main/urls.py create mode 100644 Nasa-TEST/staticfiles/css/custom.css create mode 100644 Nasa-TEST/templates/caruserl.html create mode 100644 Nasa-TEST/templates/css.html create mode 100644 Nasa-TEST/templates/headers.html create mode 100644 Nasa-TEST/templates/index.html create mode 100644 Nasa-TEST/templates/nav.html create mode 100644 Nasa-TEST/templates/script.html create mode 100644 Nasa-TEST/templates/seo.html create mode 100644 Nasa-TEST/templates/welcome.html diff --git a/Nasa-TEST/Dockerfile b/Nasa-TEST/Dockerfile new file mode 100644 index 0000000..6430375 --- /dev/null +++ b/Nasa-TEST/Dockerfile @@ -0,0 +1,14 @@ +# Используем базовый образ с MySQL +FROM mysql:latest + +# Определение переменных окружения для MySQL +ENV MYSQL_ROOT_PASSWORD=Ax123456 +ENV MYSQL_DATABASE=django_db +ENV MYSQL_USER=django_user +ENV MYSQL_PASSWORD=Ax123456 + +# Копирование sql-скрипта и настройка инициализации БД +COPY init.sql /docker-entrypoint-initdb.d/ + +# Определяем порт для доступа к MySQL +EXPOSE 3306 diff --git a/Nasa-TEST/docker-compose.yml b/Nasa-TEST/docker-compose.yml new file mode 100644 index 0000000..c9a59bd --- /dev/null +++ b/Nasa-TEST/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3' + +services: + db: + build: . + container_name: mysql_django_db + ports: + - "3306:3306" + volumes: + - mysql_data:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: Ax123456 + MYSQL_DATABASE: django_db + MYSQL_USER: django_user + MYSQL_PASSWORD: Ax123456 + + web: + build: . + container_name: django_app + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/app + ports: + - "8000:8000" + depends_on: + - db + +volumes: + mysql_data: diff --git a/Nasa-TEST/init.sql b/Nasa-TEST/init.sql new file mode 100644 index 0000000..e69de29 diff --git a/Nasa-TEST/main/urls.py b/Nasa-TEST/main/urls.py new file mode 100644 index 0000000..7baf226 --- /dev/null +++ b/Nasa-TEST/main/urls.py @@ -0,0 +1,6 @@ +from django.urls import path, include +from .views import MainView +# +urlpatterns = [ + path('', MainView.as_view(), name='main'), +] \ No newline at end of file diff --git a/Nasa-TEST/staticfiles/css/custom.css b/Nasa-TEST/staticfiles/css/custom.css new file mode 100644 index 0000000..a815099 --- /dev/null +++ b/Nasa-TEST/staticfiles/css/custom.css @@ -0,0 +1,50 @@ +.image-container { + position: relative; + display: flex; + justify-content: center; + align-items: center; + height: 480px; +} + +.image-nav-container { + position: relative; + display: flex; + justify-content: center; + align-items: center; + height: 120px; +} + +.rounded-image { + border-radius: 30px; + max-width: 100%; + max-height: 100%; + object-fit: cover; + object-position: center; +} + +.thumbnail { + width: 100px; + height: 100px; + margin: 10px; +} + +@media (min-width: 767px) { + .section-img-col { + width: 100%; + height: auto; + } + +} +@media (max-width: 767px) { + .section-img-col { + width: 100%; + height: auto; + } + .rounded-image { + height: 380px; + border-radius: 20px; + } + .image-nav-container { + height: 48px; + } +} diff --git a/Nasa-TEST/templates/caruserl.html b/Nasa-TEST/templates/caruserl.html new file mode 100644 index 0000000..5408ac4 --- /dev/null +++ b/Nasa-TEST/templates/caruserl.html @@ -0,0 +1,27 @@ +{% load static %} +
+
+

Фотографии

+
+
+ {% for item in slider_items %} +
+
+ {{ item.title }} +
+
+ {% endfor %} +
+ +
+ {% for item in slider_items %} +
+
+ {{ item.title }} +
+
+ {% endfor %} +
+
+
+
diff --git a/Nasa-TEST/templates/css.html b/Nasa-TEST/templates/css.html new file mode 100644 index 0000000..87d057f --- /dev/null +++ b/Nasa-TEST/templates/css.html @@ -0,0 +1,8 @@ +{% load static %} + + + + + + + \ No newline at end of file diff --git a/Nasa-TEST/templates/headers.html b/Nasa-TEST/templates/headers.html new file mode 100644 index 0000000..0558a68 --- /dev/null +++ b/Nasa-TEST/templates/headers.html @@ -0,0 +1,8 @@ +
+
+

Космическое агентство

+
+

Национальное управление по аэронавтике и исследованию космического пространства — ведомство, относящееся к федеральному правительству США и подчиняющееся непосредственно президенту США.

+
+
+
diff --git a/Nasa-TEST/templates/index.html b/Nasa-TEST/templates/index.html new file mode 100644 index 0000000..e6ad111 --- /dev/null +++ b/Nasa-TEST/templates/index.html @@ -0,0 +1,18 @@ +{% load static %} + + + + {% include 'seo.html' %} + {{ title }} + + {% include 'css.html' %} + + {% include 'script.html' %} + + + {% include 'nav.html' %} + {% include 'headers.html' %} + {% include 'welcome.html' %} + {% include 'caruserl.html' %} + + \ No newline at end of file diff --git a/Nasa-TEST/templates/nav.html b/Nasa-TEST/templates/nav.html new file mode 100644 index 0000000..3bbd4e2 --- /dev/null +++ b/Nasa-TEST/templates/nav.html @@ -0,0 +1,30 @@ +{% load static %} + diff --git a/Nasa-TEST/templates/script.html b/Nasa-TEST/templates/script.html new file mode 100644 index 0000000..0f21ea7 --- /dev/null +++ b/Nasa-TEST/templates/script.html @@ -0,0 +1,39 @@ +{% load static %} + + + + + + + + + + + + diff --git a/Nasa-TEST/templates/seo.html b/Nasa-TEST/templates/seo.html new file mode 100644 index 0000000..cf2452e --- /dev/null +++ b/Nasa-TEST/templates/seo.html @@ -0,0 +1,6 @@ +{% load static %} + + + + + \ No newline at end of file diff --git a/Nasa-TEST/templates/welcome.html b/Nasa-TEST/templates/welcome.html new file mode 100644 index 0000000..743a10d --- /dev/null +++ b/Nasa-TEST/templates/welcome.html @@ -0,0 +1,58 @@ +{% load static %} +
+
+
+
+
+
+
+ + + + + + + + + + + + +

Спейс шаттлы — пилотируемые корабли

+
+
+
+
+ + + + +

Лучшее телескопическое оборудование

+
+
+
+
+ + + + +

Целимся на Луну и Марс

+
+
+
+
+ + + +

Золотая медаль по научным исследованиям

+
+
+
+
+
+ Bootstrap Themes +
+
+
+ +