work splash-screen
This commit is contained in:
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.
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class WebConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'web'
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user