From ec40a53d98fb8cded1b13ece08201dfbf22a2a38 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Wed, 28 Dec 2022 18:57:42 +0500 Subject: [PATCH 1/3] =?UTF-8?q?=D0=92=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20=D0=B6?= =?UTF-8?q?=D1=83=D1=80=D0=BD=D0=B0=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20#27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- crossposting_backend/private/settings.example.py | 32 +++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a2942fe..5d32b68 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ db.sqlite3 __pycache__/ identifier.sqlite vk_config.v2.json -crossposting_backend/private/settings.py \ No newline at end of file +crossposting_backend/private/settings.py +logs/ \ No newline at end of file diff --git a/crossposting_backend/private/settings.example.py b/crossposting_backend/private/settings.example.py index d709879..6f51a94 100644 --- a/crossposting_backend/private/settings.example.py +++ b/crossposting_backend/private/settings.example.py @@ -1,7 +1,37 @@ +from os import path +from pathlib import Path + # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-aaaa' SALT = 'aaaaaaaa' -ALLOWED_HOSTS = [] \ No newline at end of file +ALLOWED_HOSTS = [] + +LOG_DIR = path.join(Path(__file__).resolve().parent.parent.parent, 'logs/') + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'standard': { + 'format': '%(asctime)s [%(levelname)s]- %(message)s' + } + }, + 'handlers': { + 'file': { + 'level': 'ERROR', + 'class': 'logging.FileHandler', + 'filename': LOG_DIR + 'application.log', + 'formatter': 'standard' + }, + }, + 'loggers': { + 'django': { + 'handlers': ['file'], + 'level': 'ERROR', + 'propagate': True, + }, + }, +} -- 2.11.0 From d95bdf1c9e9876829ddab0db4d523b8e53d1893c Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Wed, 28 Dec 2022 19:22:57 +0500 Subject: [PATCH 2/3] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20requirements.txt=20#27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index e78a5c6..6ec1115 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,14 @@ asgiref==3.5.2 +beautifulsoup4==4.11.1 certifi==2022.12.7 charset-normalizer==2.1.1 Django==4.1.4 +django-bootstrap-v5==1.0.11 django-dotenv==1.4.2 idna==3.4 ok-api==1.0.1 requests==2.28.1 +soupsieve==2.3.2.post1 sqlparse==0.4.3 urllib3==1.26.13 vk-api==11.9.9 -- 2.11.0 From 88563f1cb85883efce21f34c687284884fb03adf Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Thu, 29 Dec 2022 11:29:29 +0500 Subject: [PATCH 3/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D0=B8=D0=BA=20(origin)=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20csrf=20#27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crossposting_backend/private/settings.example.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crossposting_backend/private/settings.example.py b/crossposting_backend/private/settings.example.py index 6f51a94..eba2761 100644 --- a/crossposting_backend/private/settings.example.py +++ b/crossposting_backend/private/settings.example.py @@ -7,7 +7,9 @@ DEBUG = False SECRET_KEY = 'django-insecure-aaaa' SALT = 'aaaaaaaa' -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['localhost'] + +CSRF_TRUSTED_ORIGINS = ['http://zakonvremeni.ru:8989',] LOG_DIR = path.join(Path(__file__).resolve().parent.parent.parent, 'logs/') -- 2.11.0