From d3fa132e9d2e762fe0f777e4a745fa96171bf0d4 Mon Sep 17 00:00:00 2001 From: Nukeap <53114367+Nukeap@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:57:08 +0300 Subject: [PATCH] 12 --- src/portal/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 162 -> 0 bytes src/portal/__pycache__/asgi.cpython-310.pyc | Bin 911 -> 0 bytes .../__pycache__/settings.cpython-310.pyc | Bin 4869 -> 0 bytes src/portal/__pycache__/urls.cpython-310.pyc | Bin 2026 -> 0 bytes src/portal/asgi.py | 28 --- src/portal/settings.py | 223 ------------------ src/portal/urls.py | 68 ------ src/portal/wsgi.py | 16 -- 9 files changed, 335 deletions(-) delete mode 100644 src/portal/__init__.py delete mode 100644 src/portal/__pycache__/__init__.cpython-310.pyc delete mode 100644 src/portal/__pycache__/asgi.cpython-310.pyc delete mode 100644 src/portal/__pycache__/settings.cpython-310.pyc delete mode 100644 src/portal/__pycache__/urls.cpython-310.pyc delete mode 100644 src/portal/asgi.py delete mode 100644 src/portal/settings.py delete mode 100644 src/portal/urls.py delete mode 100644 src/portal/wsgi.py diff --git a/src/portal/__init__.py b/src/portal/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/portal/__pycache__/__init__.cpython-310.pyc b/src/portal/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 06ba213fabab3b895009636cadf7729dba79d155..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmd1j<>g`kf<^l{Q$h4&5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!HkvsFxJacWU< zOmSs#NosC!X+c4LQAvzTYH@Z+enCt@QGQlxa!E{pe^7{{PrS3gi%|?nL1Io!e0*kJ dW=VX!UP0w84x8Nkl+v73JCO0kOhAH#0RTUmCxHL} diff --git a/src/portal/__pycache__/asgi.cpython-310.pyc b/src/portal/__pycache__/asgi.cpython-310.pyc deleted file mode 100644 index 72abc775a1268688da1efaec90202c0ba7f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naO~4li4}9%lORN@JN@E(@L>vJL=Qsoqp|h<5-aT~w6%25m!L*J+JUMc|Sh>j??d zeSi(yNBoMYN;IvaT!eECzz15agjrQ8H6@K=S2$gkR$8lJF48EK^|iXHsc62mCe~__ z0wDNEf&@J;*HjHyfB{mq8fL3{;r4(Cwg`_zl*pZ` z0IN!vQ^eY8i&3BUuFE?>J-3)8fxA+Q0Y1-V4G6Y@KbX;XuT3-N44 zRwOkpNM@>1Sr#LL7&z-n`PoXhIi@BLR)@Eu#|?}hy5fRlj1 zU($5v{SF!~H8;mI9J|1BEXQy>$HIq6v+Qf`75AE-EqJj=lROD+qH(Bmn` zPuy$nD4R($+$(mPw&@>X{F>v&{y%W@+%z`@+F35cvmlYqG8{L@vQt@xeVt|5SKJi) z5@dejrr9644Et}6XaB{`u>XX$e&A-=e*p8}xg7g9Zl3)sx4`}d*7!5G$o`2t#{Q8# TPWKC6`0xx*pL7&`=YIQN=|5&7 diff --git a/src/portal/__pycache__/urls.cpython-310.pyc b/src/portal/__pycache__/urls.cpython-310.pyc deleted file mode 100644 index f5192f1baa2dd6558596c3ffc38e3642d77721fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2026 zcmb7F%a7Yc7`GkgXG3Xy2ORB5SfmtunD;66kpDZVJRv*Wwlm< zwTe?wxD4{DQ&qSUT2alZDO?TfQNw8{Y=sL^(`hPP3tQ2mv#4vNMjGQKT*nQ(fSbn! z+#=QSxq*%sj|H#w+91rv~72WO=*>9xfm2cm=N>7eKZKvh(=7k{b9zF1@Iv zmvZUlTzZ8R@oP_YrR#OTD93LAely2!0e(Bj?*M*R;$f9E$>R6|{4V15v9YE(m+<vqDf2`?V>F-)C6oy-Lz~+t$6$ya;shE$e<7`^sZwRw=#OMLmp>7o#AOF>E0; zU^GI}k?SQ%F3j9i{A)R1Mj!(?6CrGcU`Oli_C_Aph(=@s#a=`{Y)jnkSa(8?^UZw- z44={ZZ(dL_B1}5cRUXgX`3Q9VA8#bT>v2~qS?|2!(RS>IDGuTxBthAep~(ZD=Vx0b z27xPZJd#V+J7|!naw|($b{t)q@VS#YcS9xRKYP0$(xD9roLg#3fzsRVbgbWGZ+G-r z(Zf*?12ARAJI1V>^I0JylvSNE4wNz@u43u4T0&S9a1KQ)SDHg2T<(uZ}(^7f^>jpb95KK!SMM0`1dprazs0aq`vl+4Kk0d$>I@58m%yP2Ynhn4#& zDkqhEpY4=$G+E4f`Ft}CCM8Co=WM5_{wMXEkbn#O|Llg1pXGn+K!YU~{Z zL)Fvvq`6UG*_zTlAO!Dw{u9tWhuP|i+&LsMVP5DScz$kSX+&b-GD^iKoy)Vb>w?U6orS!9q3i_<_8HuB8XSbWW7Kw4SIm^+1xC1V2MqFe zNZAus1R*QQp$r44VgvWc%;A91M0K0o4uL_AI8&Dg(7_!GEY`}w8Yf4H-|*L&dJ*|~eI zpI!fb=|nd;HI-f~gzoHUBayCB5`V{lao_RbM^B LGF~jSD!=~?NeqA( diff --git a/src/portal/asgi.py b/src/portal/asgi.py deleted file mode 100644 index 7032be3f6..000000000 --- a/src/portal/asgi.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -ASGI config for portal 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.2/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application -from channels.auth import AuthMiddlewareStack -from channels.routing import ProtocolTypeRouter, URLRouter -from channels.security.websocket import AllowedHostsOriginValidator -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portal.settings') - -application = get_asgi_application() -import watcher.routing - -application = ProtocolTypeRouter( - { - "http": get_asgi_application(), - "websocket": AllowedHostsOriginValidator( - AuthMiddlewareStack(URLRouter(watcher.routing.websocket_urlpatterns)) - ), - } -) \ No newline at end of file diff --git a/src/portal/settings.py b/src/portal/settings.py deleted file mode 100644 index e3d1bd934..000000000 --- a/src/portal/settings.py +++ /dev/null @@ -1,223 +0,0 @@ -""" -Django settings for portal project. - -Generated by 'django-admin startproject' using Django 4.2.3. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/4.2/ref/settings/ -""" - -from pathlib import Path -import os - -CORS_ORIGIN_ALLOW_ALL=True -# Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent - -LIST_PER_PAGE=25 -SECRET_KEY='V7bvDZMztr3EU8S9g1Dipw' -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -# SECRET_KEY = 'django-insecure-%h9885^t5#hezrzb(zf!=)8*ko_-dqn!1*_g@9^9@b#h$#194k' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] -CHANNEL_LAYERS = { - "default": { - "BACKEND": "channels_redis.core.RedisChannelLayer", - "CONFIG": { - "hosts": [("127.0.0.1", 6379)], - }, - }, - -} - -# Application definition - -INSTALLED_APPS = [ - 'daphne', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'rest_framework', - 'djoser', - 'rest_framework_simplejwt', - 'navigation.apps.NavigationConfig', - 'drf_yasg', - 'accounts', - # 'orgmanagment', - 'corsheaders', - 'watcher.apps.WatcherConfig', - 'userauth.apps.UserauthConfig', - 'feedback.apps.FeedbackConfig', - 'general_vacation.apps.GeneralVacationConfig' - -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - # 'django.contrib.auth.middleware.RemoteUserMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] -AUTHENTICATION_BACKENDS = [ - # 'django.contrib.auth.backends.RemoteUserBackend', - 'django.contrib.auth.backends.ModelBackend', - 'accounts.backends.CustomAuth' - - -] -REST_FRAMEWORK = { - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', - 'PAGE_SIZE': 10, - 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework_simplejwt.authentication.JWTAuthentication', - - ), - -} - -ROOT_URLCONF = 'portal.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 = 'portal.wsgi.application' -ASGI_APPLICATION = "portal.asgi.application" - -# Database -# https://docs.djangoproject.com/en/4.2/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - }, - 'user_directory':{ - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'userauth.sqlite3', - } -} - - -# Password validation -# https://docs.djangoproject.com/en/4.2/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', - }, -] -AUTH_USER_MODEL = 'accounts.User' - -# Internationalization -# https://docs.djangoproject.com/en/4.2/topics/i18n/ - -LANGUAGE_CODE = 'ru' - -# TIME_ZONE = 'UTC' -TIME_ZONE = 'Europe/Moscow' - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.2/howto/static-files/ - - -STATIC_URL = '/static/' -STATICFILES_DIRS = ( - BASE_DIR.joinpath('static'), -) -# STATIC_ROOT = BASE_DIR.joinpath('static') - -# Media -MEDIA_URL = '/media/' -MEDIA_ROOT = BASE_DIR.joinpath('media') -# Default primary key field type -# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' - -from datetime import timedelta - - -SIMPLE_JWT = { - "ACCESS_TOKEN_LIFETIME": timedelta(minutes=30), - "REFRESH_TOKEN_LIFETIME": timedelta(days=1), - "ROTATE_REFRESH_TOKENS": False, - "BLACKLIST_AFTER_ROTATION": False, - "UPDATE_LAST_LOGIN": False, - - "ALGORITHM": "HS256", - "SIGNING_KEY": SECRET_KEY, - "VERIFYING_KEY": "", - "AUDIENCE": None, - "ISSUER": None, - "JSON_ENCODER": None, - "JWK_URL": None, - "LEEWAY": 0, - - "AUTH_HEADER_TYPES": ("Bearer",), - "AUTH_HEADER_NAME": "HTTP_AUTHORIZATION", - "USER_ID_FIELD": "id", - "USER_ID_CLAIM": "user_id", - "USER_AUTHENTICATION_RULE": "rest_framework_simplejwt.authentication.default_user_authentication_rule", - - "AUTH_TOKEN_CLASSES": ("rest_framework_simplejwt.tokens.AccessToken",), - "TOKEN_TYPE_CLAIM": "token_type", - "TOKEN_USER_CLASS": "rest_framework_simplejwt.models.TokenUser", - - "JTI_CLAIM": "jti", - - "SLIDING_TOKEN_REFRESH_EXP_CLAIM": "refresh_exp", - "SLIDING_TOKEN_LIFETIME": timedelta(minutes=5), - "SLIDING_TOKEN_REFRESH_LIFETIME": timedelta(days=1), - - "TOKEN_OBTAIN_SERIALIZER": 'accounts.backends.MyTokenObtainPairSerializer', - "TOKEN_REFRESH_SERIALIZER": "rest_framework_simplejwt.serializers.TokenRefreshSerializer", - "TOKEN_VERIFY_SERIALIZER": "rest_framework_simplejwt.serializers.TokenVerifySerializer", - "TOKEN_BLACKLIST_SERIALIZER": "rest_framework_simplejwt.serializers.TokenBlacklistSerializer", - "SLIDING_TOKEN_OBTAIN_SERIALIZER": "rest_framework_simplejwt.serializers.TokenObtainSlidingSerializer", - "SLIDING_TOKEN_REFRESH_SERIALIZER": "rest_framework_simplejwt.serializers.TokenRefreshSlidingSerializer", -} \ No newline at end of file diff --git a/src/portal/urls.py b/src/portal/urls.py deleted file mode 100644 index b4817fde9..000000000 --- a/src/portal/urls.py +++ /dev/null @@ -1,68 +0,0 @@ -""" -URL configuration for portal project. - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/4.2/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 -from django.urls import include, path -from rest_framework import routers -from django.urls import re_path -from rest_framework import permissions -from drf_yasg.views import get_schema_view -from drf_yasg import openapi -from django.conf.urls.static import static -from django.conf import settings - - -schema_view = get_schema_view( - openapi.Info( - title="Портал API", - default_version='v0.1', - description="API портала инспекции 9966", - # terms_of_service="https://www.google.com/policies/terms/", - # contact=openapi.Contact(email="contact@snippets.local"), - # license=openapi.License(name="BSD License"), - ), - public=True, - permission_classes=(permissions.AllowAny,), -) - - - - - -# router = routers.DefaultRouter() -# router.register(r'users', views.UserViewSet) -# router.register(r'groups', views.GroupViewSet) - -# Wire up our API using automatic URL routing. -# Additionally, we include login URLs for the browsable API. -urlpatterns = [ - - path('admin/', admin.site.urls), - # path('auth/', include('djoser.urls')), - # path('auth/', include('djoser.urls.jwt')), - - #path to our account's app endpoints - path('swagger/', schema_view.without_ui(cache_timeout=0), name='schema-json'), - path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), - path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), - path("api/accounts/",include("accounts.urls")), - path("api/navigation/",include("navigation.urls")), - path('api/watcher/', include('watcher.urls')), - path('api/feedback/', include('feedback.urls')), - path('api/general_vacation/', include('general_vacation.urls')), - -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/src/portal/wsgi.py b/src/portal/wsgi.py deleted file mode 100644 index 3c84f437c..000000000 --- a/src/portal/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for portal 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.2/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portal.settings') - -application = get_wsgi_application()