work splash-screen

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

No files matched your search

View File
Whitespace-only changes.
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.
+10
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
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+6
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
Whitespace-only changes.
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+38
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)