From 2dcb938970cff3f1de168359c7961fd1dba04a2d Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Fri, 9 Dec 2022 19:49:19 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=84=D0=B8=D0=BA=D1=81=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + README.md | 0 crossposting_backend/__init__.py | 0 .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 192 bytes .../__pycache__/settings.cpython-311.pyc | Bin 0 -> 2659 bytes .../__pycache__/urls.cpython-311.pyc | Bin 0 -> 1074 bytes .../__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 756 bytes crossposting_backend/asgi.py | 16 +++ crossposting_backend/settings.py | 123 +++++++++++++++++++++ crossposting_backend/urls.py | 21 ++++ crossposting_backend/wsgi.py | 16 +++ manage.py | 22 ++++ 12 files changed, 201 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 crossposting_backend/__init__.py create mode 100644 crossposting_backend/__pycache__/__init__.cpython-311.pyc create mode 100644 crossposting_backend/__pycache__/settings.cpython-311.pyc create mode 100644 crossposting_backend/__pycache__/urls.cpython-311.pyc create mode 100644 crossposting_backend/__pycache__/wsgi.cpython-311.pyc create mode 100644 crossposting_backend/asgi.py create mode 100644 crossposting_backend/settings.py create mode 100644 crossposting_backend/urls.py create mode 100644 crossposting_backend/wsgi.py create mode 100755 manage.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d84f56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +.python-version +db.sqlite3 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/crossposting_backend/__init__.py b/crossposting_backend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/crossposting_backend/__pycache__/__init__.cpython-311.pyc b/crossposting_backend/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79a0d95e225489b43f2dcabd651fccee8f4a59d6 GIT binary patch literal 192 zcmZ3^%ge<81R5TblR@-j5CH>>P{wCAAY(d13PUi1CZpdO$etJ=2Zf91TvDtbP+5|Zp9kkA7v&ch7vvY0Wag#ECnY9lr{<;T zC+8QX>c_`t=4F<|$LkeT{^GF7%}*)KNwq6t1=;~}MKM2+_`uA_$oPQ)Miemv#QU}< z=1IpE=%GLl?IDLEhZIFVqQBr2L2K}2pqKVWAh(=4)Wa5J19b^%I6Lo|o!Qkd$z&YC z^GETA#%~FP{_+=tC(=jW{SC;E2qOt$1_v}o4@dz91rQ04;4229*YN8-KZgd`@b?ug zULO&5!UOaelOi}MMR7=qHIX#dL^%ACk>c=;z;_%+r33~J4q=}cf61r}9)A&PGEx#J zq!do#6p7#oXB;7%ei2X^X#!8;3`kAlb6q&qh38eK8IscYf;5Szr40Bx2fryiBb~<= zr3?6yh_aWJPa&OnVMj5VCQFHJt45QuTc*V}ER)ifNqvgEsWhGt1G6p5+#wB{i^o@q zK`g~4nBClCuj8(Pc?IjL!BShX?7rl6woSnR+xM`<-Q<=)dj%ZmrbSrQ0AIRdtER!i zYj3OIUDe1Z5DbZL+jfh7mdjzYLAjofK?Ds`&k-XB26MLAQX4ckh(6adZ*LQJtF39Q zrc#?Vw~n(@AQ9lI7W+)m+JyceUl!RKa`cbCxmm^yRTX>NS?*UsH7IGcEi(UP*S^!d zb9-Sii*;*u(OQ^O<{vcdommwx%u#*m`NGb#yUq5k?FHG&UcEAFH|yDmGu1Q0HB7^{ z)J?8iROj3%wGAFGj}UzoV%YXxi%@5Jgh>gdQ09{i9T-XzG%k&5*sw7Te>-S4>dg1K zx{9$zb`^_o-8@x$j}!fb0a-iZIZLC)`tG?QeX&Oy(#oE60z0jn2AA)C{zH^nTU;K% zW0mXZUfjjX0z@n#7<~!^&&D@(pR-J|ziFZ9Lh5DS~0(zFM&q zom5(W*V7@ri>J*T*S0k3bUUi0P`YbcScY>&#a(yYIwclw`-9xJ ziKyzTruc*MxF=y+&i%7mT2l>GZ|fyuH0|wU{V&d{-y5K6KgMGN56)_!+}4SuHcnay z6Jx$j-QapX??mDBhe66YANI{cC3O=MjdIIs69&y(QHh4j*=aW_%W$yEvKwu|@u{hs zRuD?-#$?$)a(uc)sHr_8ZlndLjbXd7WnL8gZFl3Mkgo}K`H}Fo8!iaT>#J^(FO@1A zLP3655$mFxDwf4MkbnTaBD(RlVxdqHHu#$0CTf*RU0$!1@|E(6J60FgswKWIh;DjA zTrK+YrDC4<+sYj)@O9pIE4nlMdi|kX73jufi7&6N^Q(fKuM`9@ zSX>iisRAt%TZe#)H}96+h>z7Jh`bJ#^S*aCQxI18^-^61%N2R0D3l7nqIdqK@?Oks zn>xu^1e52vs%19e$bj+#=3l@xSKYI>P2*^JTJPr?aKj$mR$OcEee51=MO!2Ht!v=J z|06>MfL@Sc7%vcKLLTzL3}PD;g40n*8`RU%9^mQ*BOoN~g zg5j>YiM$&lRQjJcE%3JCpxi1NG{?f VP-+^2kE08>_EDzyS|33<{{=b9cT@lX literal 0 HcmV?d00001 diff --git a/crossposting_backend/__pycache__/urls.cpython-311.pyc b/crossposting_backend/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40faf63425dd833a7001d99db5bfe658c6a889ff GIT binary patch literal 1074 zcma)5&ubJh6wb`fZtK+6s|S%t54!_(LPal&Kagr^LA0p7>}8srWOrwsOok+@tswO1 zQLx~DposrW1rIV;Pu>=K+mkP|GqQ?8Gn4QVUcUFe@4b9lUG))+&d&RI<|6dNZtCGx z#@QYi9}q)5#2n_Pj&OUfW9>%T5MIx7kc+s-JnoL0_2qG^wmt&x7nt)gbb3py`3wau z`UVbTCAH3_Hc2*&`ZRvQGlut{KEhiv8zjStq9&1`@Ld@xaIPL1Iz(+4th%rV{+XkgvnTkY)rGE%#|GT z*o3hZglFVtxJiu6lUNh$Odz}_{=-8m084lM?MW6}cJr_$=w^uTGlpq~6Ol`0x)=|X z6j&TZG|#KU1^*kBf0;5Qu#h2Kg=9yac6+1BYa|8Vz!??%PTSh;z~4%#*4O)x7+XO7 z9}8(lTv;MvDO62o2e3-^=VW93L#iVS(h2@zw4250gh4eygfgB@Erw#&`s|j%V4wo! zvA(<$;6Wv2cP`hw9HAAwCRzDzl%kxQZ9kPm0s_{N+V-HtZ3lt>)3#*b6iv!Rl7Zn_ z#b39|EqNR)7fVqD{SigQT15#mF)Hb+2HY%G7I-TAS_)4mh8LbCUaTw>^D{cLv1U(* zEgVst@k6qwD&dK zWoEUZx_tD@dDE`dX()Ivj%ZIv8cLy5CX|kOqdIu>AxdBsj!`4g(oqg?Nx6qup+hWl088w5NOb55a1J>=dacgyRG11&s;St3R$a_t?c zDE6G+#l0IEv_@6S zdD-_3AK%X{q4L`^R&Ho6;}#gwHmG?S`7oA(=Z;Ba*bDX(ov$pwe}#*J-lcEYr|3y! zc<8mHh-8qaD2-NhUU{vN?hF3UypEf9t+U|bW~0j+Pi8OkR8|b0`2j(_HOtf{giNh6 zDNUhR?f`L)Zx&+$TjT%d1g!VY4_NyKYvXly{IGcjt#fFNp*5*&j4K;wmCf_Y=J84~ IeOR{#J2 literal 0 HcmV?d00001 diff --git a/crossposting_backend/asgi.py b/crossposting_backend/asgi.py new file mode 100644 index 0000000..fe9953f --- /dev/null +++ b/crossposting_backend/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for crossposting_backend project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crossposting_backend.settings') + +application = get_asgi_application() diff --git a/crossposting_backend/settings.py b/crossposting_backend/settings.py new file mode 100644 index 0000000..a215258 --- /dev/null +++ b/crossposting_backend/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for crossposting_backend project. + +Generated by 'django-admin startproject' using Django 4.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.1/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-kwt7g7603)dmr(3r0*a-@ctj(id0*sm4x0jv8gu5h0_r)#!(tg' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'crossposting_backend.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'crossposting_backend.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/crossposting_backend/urls.py b/crossposting_backend/urls.py new file mode 100644 index 0000000..4a330b6 --- /dev/null +++ b/crossposting_backend/urls.py @@ -0,0 +1,21 @@ +"""crossposting_backend URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/crossposting_backend/wsgi.py b/crossposting_backend/wsgi.py new file mode 100644 index 0000000..b3fea92 --- /dev/null +++ b/crossposting_backend/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for crossposting_backend project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crossposting_backend.settings') + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..7745c05 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crossposting_backend.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()