work splash-screen

This commit is contained in:
erjemin
2021-07-23 23:10:33 +03:00
commit 0ac496386c
67 changed files with 1153 additions and 0 deletions

0
cadpoint/web/__init__.py Normal file
View 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
from cadpoint.settings import *
def check_cookies(request) -> bool:
# проверка, что посетитель согласился со сбором данных через cookies
if request.COOKIES.get('cookie_accept'):
return False
return True

3
cadpoint/web/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
cadpoint/web/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class WebConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'web'

View File

3
cadpoint/web/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
cadpoint/web/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

38
cadpoint/web/views.py Normal file
View File

@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
from django.shortcuts import render
from web.add_function import *
# Create your views here.
def handler404(request, exception: str) -> render:
""" Обработчик ошибки 404
:param request: http-запрос
:param exception: сообщение с причиной ошибки
:return: response: http-ответ
"""
response = render(request, "404.html", {"MSG": exception})
response.status_code = 404
return response
def handler500(request) -> render:
""" Обработчик ошибки 500
:param request:
:return: response:
"""
response = render(request, "500.html", {})
response.status_code = 500
return response
def index(request) -> render:
""" Главная страница
:param request:
:return: response:
"""
template = "index.jinja2" # шаблон
template = "under_reconstruction.jinja2" # шаблон
to_template = {"COOKIES": check_cookies(request)}
return render(request, template, to_template)