From 899b00070e140681ac6767b7ce639acfd54e3730 Mon Sep 17 00:00:00 2001 From: Alpha Bo <125365666+Sonder-MX@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:24:50 +0800 Subject: [PATCH] Delete dv_site directory --- dv_site/__init__.py | 0 dv_site/asgi.py | 16 ------ dv_site/settings.py | 133 -------------------------------------------- dv_site/urls.py | 34 ----------- dv_site/wsgi.py | 16 ------ 5 files changed, 199 deletions(-) delete mode 100644 dv_site/__init__.py delete mode 100644 dv_site/asgi.py delete mode 100644 dv_site/settings.py delete mode 100644 dv_site/urls.py delete mode 100644 dv_site/wsgi.py diff --git a/dv_site/__init__.py b/dv_site/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dv_site/asgi.py b/dv_site/asgi.py deleted file mode 100644 index acf1924..0000000 --- a/dv_site/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for dv_site 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', 'dv_site.settings') - -application = get_asgi_application() diff --git a/dv_site/settings.py b/dv_site/settings.py deleted file mode 100644 index 6a40a73..0000000 --- a/dv_site/settings.py +++ /dev/null @@ -1,133 +0,0 @@ -""" -Django settings for dv_site project. - -Generated by 'django-admin startproject' using Django 4.1.7. - -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 datetime import timedelta -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-lxq5^#)ym=tb5h)se-r@a^5vi7lkqve3ic98(fscs1yue2r%r!' - -# 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', - 'corsheaders', - 'dlogin', -] - -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.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'dv_site.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 = 'dv_site.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 = 'zh-hans' - -TIME_ZONE = 'Asia/Shanghai' - -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' - -CORS_ORIGIN_WHITELIST = [ - "http://localhost:8080", -] - -REST_FRAMEWORK = {'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework_simplejwt.authentication.JWTAuthentication']} - -SIMPLE_JWT = { - "ACCESS_TOKEN_LIFETIME": timedelta(minutes=1), - "REFRESH_TOKEN_LIFETIME": timedelta(hours=1), -} diff --git a/dv_site/urls.py b/dv_site/urls.py deleted file mode 100644 index 4e53cf5..0000000 --- a/dv_site/urls.py +++ /dev/null @@ -1,34 +0,0 @@ -"""dv_site 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 include, path -from rest_framework.routers import DefaultRouter - -from custom_token.views import (CustomTokenObtainPairView, CustomTokenRefreshView) -from dlogin import views as dviews - -router = DefaultRouter() -router.register(r'user', dviews.UserViewSet, basename='User') - -urlpatterns = [ - path('admin/', admin.site.urls), - path('api-auth/', include('rest_framework.urls')), # for browsable API - # jwt - path('api/token/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'), - path('api/token/refresh/', CustomTokenRefreshView.as_view(), name='token_refresh'), - # dlogin - path('api/', include(router.urls)), -] diff --git a/dv_site/wsgi.py b/dv_site/wsgi.py deleted file mode 100644 index 0125df2..0000000 --- a/dv_site/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for dv_site 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', 'dv_site.settings') - -application = get_wsgi_application()