Skip to content

Commit

Permalink
Add all web site's files
Browse files Browse the repository at this point in the history
  • Loading branch information
Frfor17 committed Dec 31, 2024
1 parent ef16c89 commit 106ca5b
Show file tree
Hide file tree
Showing 61 changed files with 604 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web_app/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions web_app/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions web_app/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions web_app/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions web_app/.idea/web_app.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added web_app/itproger/db.sqlite3
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions web_app/itproger/itproger/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for itproger 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', 'itproger.settings')

application = get_asgi_application()
129 changes: 129 additions & 0 deletions web_app/itproger/itproger/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
"""
Django settings for itproger project.
Generated by 'django-admin startproject' using Django 5.1.4.
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-p-@t)8qx)u^_f-jp#phaje_4_rcbc!+rxw#s%400ich_q0(wrc'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'main',
'news',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

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 = 'itproger.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 = 'itproger.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 = 'ru'

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/'

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

STATICFILES_DIRS = [
BASE_DIR / "static",
]
11 changes: 11 additions & 0 deletions web_app/itproger/itproger/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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')),
path('news/', include('news.urls'))
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
16 changes: 16 additions & 0 deletions web_app/itproger/itproger/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for itproger 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', 'itproger.settings')

application = get_wsgi_application()
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions web_app/itproger/main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions web_app/itproger/main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'main'
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions web_app/itproger/main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
70 changes: 70 additions & 0 deletions web_app/itproger/main/static/main/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
body {
background: #2c2c2c;
}

aside {
float:left;
background: #181818;
width: 20%;
padding: 2.5%;
height: 100vh;
color: #fff;
border-right: 5px solid #4d4d4d;
}

aside img {
width: 80px;
float: left;
}

aside.logo {
font-size: 40px;
margin-left: 10px;
font-weight: bold;
position: relative;
top: -5px
}

aside h3{
margin-top: 50px;
font-size: 28px;
}

aside ul {list-style: none}
aside ul li {
color: #fff;
display: block;
margin-top:20px;
transition: transform .6s ease;
}

aside ul li:hover, aside ul a:hover {
color: #eb5959;
text-decoration: none;
transform: scale(1.05);
}

main .features {
float: left;
color: #fff;
margin-top: 100px;
text-align: center;
width: 75%;
}

main .features h1 {font-size: 50px;}
main .features p {max-width: 400px; margin: 20px auto}

.alert-warning {
float: left;
clear: both;
width: 400px;
margin: 20px 34%;
text-align: left;
}

form {
margin-left: 32%;
width: 500px;
margin-top: 50px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions web_app/itproger/main/templates/main/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends 'main/layout.html'%}

{% block title %}Про нас{% endblock %}

{% block content%}
<div class="features">
<h1>Про нас</h1>
<p>Lorem ipsum</p>
<button class="btn btn-danger">Просто нажми</button>
</div>
{% endblock %}
20 changes: 20 additions & 0 deletions web_app/itproger/main/templates/main/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends 'main/layout.html'%}

{% block title %}{{ title }}{% endblock %}

{% block content%}
<div class="features">
<h1>{{ title }}</h1>
<p>На нашем сайте представлена простая информация, что может помочь вам в поиске простой информации </p>
<button class="btn btn-warning">На страницу про нас</button>
{% for el in values %}
{% if el == 'Hello' %}

<p>{{ el }}</p>
{% endif %}
{% endfor%}
{% for el in obj %}
<p>{{ el }}</p>
{% endfor%}
</div>
{% endblock %}
33 changes: 33 additions & 0 deletions web_app/itproger/main/templates/main/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{% static 'main/css/main.css' %}">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
</head>
<body>
<aside>
<img src="{% static 'main/img/krimnash2.jpg' %}" alt="Лого" width="300" height="200">
<span class="logo">itProger</span>
<h3>Навигация</h3>
<ul>
<a href="{% url 'home' %}"><li><i class="fa-solid fa-house"></i>Главная</li></a>
<a href="{% url 'about' %}"><li>Про нас</li></a>
<a href=""><li>Контакты</li></a>
<a href="{% url 'news_home' %}"><li>Новости</li></a>
<a href="{% url 'create' %}"><li><button class="btn btn-info">Добавить новую запись</button></li></a>
</ul>
</aside>
<main>
{% block content%}
{% endblock %}
</main>

</body>
</html>
3 changes: 3 additions & 0 deletions web_app/itproger/main/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
7 changes: 7 additions & 0 deletions web_app/itproger/main/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path
from . import views

urlpatterns = [
path('', views.index, name='home'),
path('about', views.about, name='about')
]
Loading

0 comments on commit 106ca5b

Please sign in to comment.