From b705da393e7c1e9c2f5649cc8153a19bf13aad4e Mon Sep 17 00:00:00 2001 From: Bewin Felix <99880789+Bewin007@users.noreply.github.com> Date: Wed, 29 Mar 2023 08:06:31 +0530 Subject: [PATCH] Add files via upload --- backend/__init__.py | 0 backend/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 141 bytes backend/__pycache__/settings.cpython-310.pyc | Bin 0 -> 2687 bytes backend/__pycache__/urls.cpython-310.pyc | Bin 0 -> 968 bytes backend/__pycache__/wsgi.cpython-310.pyc | Bin 0 -> 544 bytes backend/asgi.py | 16 ++ backend/settings.py | 163 +++++++++++++++++++ backend/urls.py | 22 +++ backend/wsgi.py | 16 ++ 9 files changed, 217 insertions(+) create mode 100644 backend/__init__.py create mode 100644 backend/__pycache__/__init__.cpython-310.pyc create mode 100644 backend/__pycache__/settings.cpython-310.pyc create mode 100644 backend/__pycache__/urls.cpython-310.pyc create mode 100644 backend/__pycache__/wsgi.cpython-310.pyc create mode 100644 backend/asgi.py create mode 100644 backend/settings.py create mode 100644 backend/urls.py create mode 100644 backend/wsgi.py diff --git a/backend/__init__.py b/backend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/__pycache__/__init__.cpython-310.pyc b/backend/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36b235ae1e11d2bce8b493c0a9b554d248ef63c6 GIT binary patch literal 141 zcmd1j<>g`kf=PD5DIoeWh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6wj%__ztF*!T2 tBqKjBCJD$&%}c?c?(9;pBT literal 0 HcmV?d00001 diff --git a/backend/__pycache__/settings.cpython-310.pyc b/backend/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..561962f86b54e873b5f13775ab3beab06cc43e49 GIT binary patch literal 2687 zcmb7GTXWM!6qXhF66Zp0K!DPUk`8rf67qSrq02l~LYrANLb#>qo!TkGAkd(PQC-#OpPo0&-q@Cj${;#c#6 z@Mkm_{Ul)U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x5O>Qblcl!)8r`)B$;Tvoqd@72K`&kQ`ftO1}q;?w4N3vuGE zbs3td8@V6}_b1eSHn=@7iyMjq3~MuGi?)FmyaFXQE@y6pNz;Uz(KN$k2ksx6Hhd96 z8>UP%;_OHc^y}HLNtoyWIl3IBwp3k<;11KemaA!o`CR)cjOVqj`gS;@mP(a9EpP5r zbVCnki)Gya5eOhhbTnJjbi*vv0M5Ni?Rl8qE#~tjZBMOfXen2z>E=+sQY!-VdN^IH zR1C9TE9ENXLO5w?yVa6vXnHuer*9V{tEFPD$L`@|UNzKcb9%U}){Pxteq9GQdGm!@ zD#9e#4`)hhdAlB60J%zD1B1m~%|sPQvQ!<8RowWl944Zkf#7@wSk6V>!-e5>0+uUg zp{SMezYG2f#H!bPST8(zxdTiHLG;|0gX}-|KYYJXIwxW3dw`^Clc(^;BrpVxBur1w zO-M;;LK0JPabAoi{z)aoD`HIgSCT|YjES+7D1MawmOe^z;!HG-zP<4+kV_-aU(#Zv J0^dX`{vTZjnX~`^ literal 0 HcmV?d00001 diff --git a/backend/__pycache__/urls.cpython-310.pyc b/backend/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a51c31f07d5f3a056e54b69c08abb123f3f15dd GIT binary patch literal 968 zcma)5O^?$s5OvaIThi{rk)v;Eq>{jjQw0dLQ0+>H10R=YrK}sfZAxrMw!^Y}?U7%? zU&@see}MyHoTgF)LRw34?9rQ<_nvKed>kMci*FC<=>VZ0cGDj|Y+k~r?L<+Es6*Y- z;cn_Wc0DKu+)F*~r@n)jM?L0lkG8{|3u~YG^l0bo+_jsI=}1 zsd!rgS0y8wVa?b)z%Vw(RC=ByROULSTO!u7QgX|36X%jAOe9a^$BB_uk?X{Q6KJoK z;LTUUp_ZNpi(2HC-M(#G^hu0gQHqJc1+SzsbBtF?a?EcsQdM2Bhd=G`tz;0;QwXUb zb~6pbS*L3wIh$cYIC~!2br=O_CDHoP5`@uS)&H@OX2X;v61PSj=$u2Xmi-;sSbR)$ zW{XUtzZhMJysT*<)?h;0&q~YTFc1D*w8mhd0>@*qY#QNJXXSiv*Zw$SYxsd=hn=;i z+?nmNlo&W#< literal 0 HcmV?d00001 diff --git a/backend/__pycache__/wsgi.cpython-310.pyc b/backend/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48c1e7195e824c7b4e8daee3365d55fdc7d74032 GIT binary patch literal 544 zcmZWm!A=`75cN8N&}~6TMLqi(iSBaf2~`LrAOz8H2vwyBX=B!tjZ?2@wKkz}?H}~Q zwH*6Jm3-}~ztB@>6DmdONHe4HXx@9C!OhK>k$pROtsW!Bel^9awW&BHcY72R8!;6r zZlX~{xn+3S8nq$@(X9P_O|{k96Q`>6m5tUFAF}TH!_WBBu-6wk+KDd21Z#04^Uq+F zsA`-+?vps~djVf6bl`-af>;hnW8{qiA)Sz-M0IQ6t${fhF_*Pow5%*aiSbxgmC?EM z8tr&Yc&EftVhuuDA}kjTftJ9v6BBJV4(*(^O&Z5;c>yz<-)@EK{)QyJRn& z;+@A-L1pm11nbi~SLihUP3vHTZWMM3@LBVgt;h&(j?a$^`CqAnr~v=~ literal 0 HcmV?d00001 diff --git a/backend/asgi.py b/backend/asgi.py new file mode 100644 index 0000000..5938c77 --- /dev/null +++ b/backend/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for 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.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_asgi_application() diff --git a/backend/settings.py b/backend/settings.py new file mode 100644 index 0000000..399bfc9 --- /dev/null +++ b/backend/settings.py @@ -0,0 +1,163 @@ +""" +Django settings for backend project. + +Generated by 'django-admin startproject' using Django 4.0.10. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/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.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-sq14lho1$bfvvck$o#q4*ym$36*e$i9q!pt$*kwl)9y+^^usr+' + +# 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', + + 'rest_framework', + "knox", + 'Downloder', + "corsheaders", + 'djongo' + +] +REST_FRAMEWORK = { + #'DEFAULT_AUTHENTICATION_CLASSES': ('knox.auth.TokenAuthentication',), + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', + 'PAGE_SIZE': 10 +} + +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', + + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", + 'django.middleware.common.BrokenLinkEmailsMiddleware', + 'django.contrib.auth.middleware.RemoteUserMiddleware', +] +CORS_ALLOWED_ORIGINS = [ + 'http://localhost:3000', + 'http://localhost:5500', +] +ROOT_URLCONF = '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 = 'backend.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.sqlite3', +# 'NAME': BASE_DIR / 'db.sqlite3', +# } +# } +DATABASES = { + 'default': { + 'ENGINE': 'djongo', + 'NAME': 'mydatabase', + 'host': 'localhost', + 'port': 27017, + } +} + + + +# MONGODB_DATABASES = { +# 'default': { +# 'name': 'mydatabase', +# 'host': 'localhost', +# 'port': 27017, +# 'username': 'myuser', +# 'password': 'mypassword', +# 'tz_aware': True, # if you want to use timezone-aware datetimes +# }, +# } + +# Password validation +# https://docs.djangoproject.com/en/4.0/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.0/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.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/backend/urls.py b/backend/urls.py new file mode 100644 index 0000000..7a522bc --- /dev/null +++ b/backend/urls.py @@ -0,0 +1,22 @@ +"""backend URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/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,include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('',include('Downloder.urls')) +] diff --git a/backend/wsgi.py b/backend/wsgi.py new file mode 100644 index 0000000..4aa3d72 --- /dev/null +++ b/backend/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for 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.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_wsgi_application()