Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/myshop.iml

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

Binary file added common/__pycache__/views.cpython-312.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions common/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class TitleMixin:
title = None

def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.title
return context
Binary file added data.json
Binary file not shown.
1 change: 1 addition & 0 deletions datebase.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="drawio-plugin" modified="2024-03-23T07:57:56.136Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" etag="HNr-F131mwMsHgnJcoWg" version="20.5.3" type="embed"><diagram name="Страница — 1" id="ox4GwTXYA2zkXbC3pGn5"><mxGraphModel dx="745" dy="332" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="wjlancOanw4fYzLR8soG-32" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="40" y="440" width="750" height="330" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-31" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="40" y="30" width="750" height="375" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-1" value="Пользователь&amp;nbsp;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"><mxGeometry x="160" y="510" width="160" height="164" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-2" value="Id" style="text;strokeColor=#6c8ebf;fillColor=#dae8fc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="26" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="52" width="160" height="8" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-4" value="Логин" style="text;strokeColor=#6c8ebf;fillColor=#dae8fc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="60" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-5" value="Пароль" style="text;strokeColor=#6c8ebf;fillColor=#dae8fc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="86" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-6" value="Телефон" style="text;strokeColor=#6c8ebf;fillColor=#dae8fc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="112" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-7" value="Почта" style="text;strokeColor=#6c8ebf;fillColor=#dae8fc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-1" vertex="1"><mxGeometry y="138" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-8" value="Корзина" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="310" y="69" width="160" height="134" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-9" value="Id" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-8" vertex="1"><mxGeometry y="26" width="160" height="22" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-10" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="wjlancOanw4fYzLR8soG-8" vertex="1"><mxGeometry y="48" width="160" height="8" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-11" value="Пользователь_ID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-8" vertex="1"><mxGeometry y="56" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-12" value="Продукты&amp;nbsp;&lt;div&gt;&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-8" vertex="1"><mxGeometry y="82" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-16" value="Количество&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-8" vertex="1"><mxGeometry y="108" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-17" value="Продукты" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="60" y="69" width="160" height="160" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-18" value="Id" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="26" width="160" height="22" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-19" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="48" width="160" height="8" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-20" value="Название" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="56" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-21" value="Изображения" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="82" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-22" value="Цена" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="108" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-23" value="Категория" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-17" vertex="1"><mxGeometry y="134" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-25" value="Продеваемый товар" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="570" y="116" width="160" height="134" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-26" value="Id" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-25" vertex="1"><mxGeometry y="26" width="160" height="22" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-27" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="wjlancOanw4fYzLR8soG-25" vertex="1"><mxGeometry y="48" width="160" height="8" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-28" value="Название&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-25" vertex="1"><mxGeometry y="56" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-29" value="&lt;div&gt;Описание&amp;nbsp;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-25" vertex="1"><mxGeometry y="82" width="160" height="26" as="geometry"/></mxCell><mxCell id="V2817OACCNWJI-HFdNwg-1" value="Категория" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="wjlancOanw4fYzLR8soG-25" vertex="1"><mxGeometry y="108" width="160" height="26" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-33" value="Архитектура сайта&amp;nbsp;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"><mxGeometry x="350" y="250" width="100" height="50" as="geometry"/></mxCell><mxCell id="wjlancOanw4fYzLR8soG-34" value="Архитектура пользователя&amp;nbsp;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"><mxGeometry x="360" y="460" width="60" height="30" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>
Binary file added db.sqlite3
Binary file not shown.
Binary file added media/products/2024/03/19/O75p4n3bBFQ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified myshop/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file modified myshop/__pycache__/urls.cpython-312.pyc
Binary file not shown.
26 changes: 13 additions & 13 deletions myshop/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
# Строим пути внутри проекта, используя BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# Быстрая настройка для разработки - не подходит для продакшена
# См. https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: храните ключ секретный ключ в безопасности!
SECRET_KEY = 'django-insecure-p@pl3p3ly2050hsq)_8otr)##+0f24r-0!)99a*0=%()=ag!6+'

# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: не включайте отладку в продакшен!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition
# Определение приложений

INSTALLED_APPS = [
'django.contrib.admin',
Expand Down Expand Up @@ -74,7 +74,7 @@
WSGI_APPLICATION = 'myshop.wsgi.application'


# Database
# База данных
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

DATABASES = {
Expand All @@ -85,7 +85,7 @@
}


# Password validation
# Проверка пароля
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
Expand All @@ -104,7 +104,7 @@
]


# Internationalization
# Мультиязычность
# https://docs.djangoproject.com/en/5.0/topics/i18n/

LANGUAGE_CODE = 'en-us'
Expand All @@ -116,7 +116,7 @@
USE_TZ = True


# Static files (CSS, JavaScript, Images)
# Статические файлы (CSS, JavaScript, изображения)
# https://docs.djangoproject.com/en/5.0/howto/static-files/

STATIC_URL = '/static/'
Expand All @@ -125,11 +125,11 @@
MEDIA_ROOT = BASE_DIR / 'media'


# Default primary key field type
# Тип поля первичного ключа по умолчанию
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'


#Users
AUTH_USER_MODEL = 'users.User '
# Пользователи
AUTH_USER_MODEL = 'users.User'
2 changes: 1 addition & 1 deletion myshop/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
path('admin/', admin.site.urls),
path('', index, name='index'),
path('adv/', include('shop.urls', namespace='products') ),
path('profile/', profile, name='profile'),
path('users/', include('users.urls', namespace='users')),
path('home/',home, name='home'),
path('contacts/',contacts, name='contacts')
]
Expand Down
Binary file modified shop/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file added shop/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file modified shop/__pycache__/views.cpython-312.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions users/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def forms():
return None
Binary file added users/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added users/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file added users/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file added users/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file added users/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file added users/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 2 additions & 3 deletions users/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.db import models

from django.contrib.auth.models import AbstractUser


Expand All @@ -8,13 +7,13 @@ class User(AbstractUser):

groups = models.ManyToManyField(
'auth.Group',
related_name='custom_user_set',
related_name='custom_user_set_groups',
blank=True,
verbose_name='Groups'
)
user_permissions = models.ManyToManyField(
'auth.Permission',
related_name='custom_user_set',
related_name='custom_user_set_permissions',
blank=True,
verbose_name='User permissions'
)
27 changes: 27 additions & 0 deletions users/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<title>{{ title }}</title>
<link href="{% static 'vendor/css/auth.css' %}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"
crossorigin="anonymous"></script>
</head>
<body class="bg-primary">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
{% block content %} {% endblock %}
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="{% static 'vendor/js/auth.js' %}"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions users/templates/email_verification.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% extends 'users/base.html' %}

{% block content %}
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">Поздравляем</h3>
</div>
<div class="card-body text-center">
<h4>Ваша учетная запись успешно подтверждена!</h4>
</div>
<div class="card-footer text-center">
<div class="small"><a href="{% url 'users:login' %}">Продолжить</a></div>
</div>
</div>
</div>
</div>
</div>
</main>
{% endblock %}
Loading