""" Django settings for website project. Generated by 'django-admin startproject' using Django 5.0.3. For more information on this file, see https://docs.djangoproject.com/en/5.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/5.0/ref/settings/ """ import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # C:/Users/HC/Desktop/视频号/后端/website/MyApi/证书 WX_CERT_PATH = '/www/wwwroot/cyqhz/证书/apiclient_cert.pem' #生产环境 WX_KEY_PATH = '/www/wwwroot/cyqhz/证书/apiclient_key.pem' #生产环境 # WX_CERT_PATH = 'C:/Users/HC/Desktop/视频号/后端/website/MyApi/证书/apiclient_cert.pem' # WX_KEY_PATH = 'C:/Users/HC/Desktop/视频号/后端/website/MyApi/证书/apiclient_key.pem' # 公众号网页配置 测试 LOGIN_APP_ID = 'wx8364534d4631c660' # 公众号appid LOGIN_APP_SECRET = '58e97d9beb933cab0cad19c2d59f3465' # 替换为你的微信APP Secret LOGIN_REDIRECT_URI = 'https://unapp.guimiaokeji.com/myapp/app_callback' # 替换为你的重定向URI LOGIN_WEB_URI = 'https://unapp.guimiaokeji.com/pay' LOGIN_WX_CERT_PATH = '/www/wwwroot/cyqhz/证书/apiclient_cert.pem' LOGIN_WX_KEY_PATH = '/www/wwwroot/cyqhz/证书/apiclient_key.pem' LOGIN_WX_MCH_ID="1674012932" LOGIN_WX_SERIAL_NO="66DB35F836EFD4CBEC66F3815D283A2892310324" LOGIN_V3_KEY="f229acb2c90b93cbc1439c185a2b26fe" LOGIN_WX_NOTIFY_URL='https://unapp.guimiaokeji.com/myapp/wpp_pay_notify/' #测试环境 # Application definitionB # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-#v*jmev%ibwm-)6fi5ffpb3b@rn_zr9_927nu%(kbxc@uvfj=-' WX_APP_ID='wxb5a1857369e5809e' WX_MCH_ID='1674012932' WX_API_KEY='f229acb2c90b93cbc1439c185a2b26fe' WX_NOTIFY_URL='https://unapp.guimiaokeji.com/myapp/wx_pay_notify/' WX_SERIAL_NO='66DB35F836EFD4CBEC66F3815D283A2892310324' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False # settings.py QINIU_ACCESS_KEY = 'AO6u6sDWi6L9TsPfr4awC7FYP85JTjt3bodZACCM' QINIU_SECRET_KEY = '2fjxweGtSAEaUdVgDkWEmN7JbBxHBQDv1cLORb9_' QINIU_BUCKET_NAME = '1726850085' QINIU_DOMAIN = 'file.guimiaokeji.com' # 如 http://yourbucket.qiniudn.com ALLOWED_HOSTS = ['*'] # settings.py # LOGIN_APP_ID = 'wxafa04cf8c4270ff9' # 替换为你的微信APP ID # LOGIN_APP_SECRET = '6c8dce18e99ee058b49aeb1e1298e111' # 替换为你的微信APP Secret # LOGIN_REDIRECT_URI = 'http://520642leen52.vicp.fun/' # 替换为你的重定向URI # Application definition INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'MyApi.apps.MyapiConfig', 'MyWeb.apps.MywebConfig', ] 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 = 'website.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [BASE_DIR / 'templates'] , '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 = 'website.wsgi.application' # Database # https://docs.djangoproject.com/en/5.0/ref/settings/#databases # DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.sqlite3', # 'NAME': BASE_DIR / 'db.sqlite3', # } # } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # 数据库引擎 'NAME': 'uinapp', # 数据库名称 'HOST': '81.70.187.27', # 数据库地址,本机 ip 地址 127.0.0.1 'PORT': 3306, # mysql端口 'USER': 'uinapp', # 数据库用户名 'PASSWORD': '6CnCBxZ77cLredtK', # 数据库密码 'OPTIONS': { 'charset': 'utf8mb4', 'use_unicode': True, }, } } # Password validation # https://docs.djangoproject.com/en/5.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/5.0/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ MEDIA_ROOT = os.path.join(BASE_DIR, 'uploaded_videos') MEDIA_URL = '/media/' STATIC_URL = 'static/' STATICFILES_DIRS = [ #设置静态文件目录 os.path.join(BASE_DIR, 'static'), BASE_DIR / 'static', ] # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'