"""
Django settings for bookLibrary project.
Generated by 'django-admin startproject' using Django 4.2.9.
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/
"""
import os
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.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-nu%ncuu0j+#hurm=6v5z$xriwo)bo+ob6&&e(gq4i*1&@@0h@_'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# settings.py
# AUTH_USER_MODEL = 'bookModel.Reader' # 'your_app' 替换为你的应用程序名称
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bookModel',
]
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',
]
STATIC_URL = '/static/'
ROOT_URLCONF = 'bookLibrary.urls'
# 静态文件的额外目录
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
# 如果需要,添加更多目录
]
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 = 'bookLibrary.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': 'library', # 数据库名称
'HOST': '127.0.0.1', # 地址
'PORT': '1433', # 端口
'USER': 'sa', # 用户名
'PASSWORD': '123456', # 密码
'OPTIONS': {
'driver': 'ODBC Driver 17 for SQL Server',
'MARS_Connection': True,
},
}
}
# 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',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.2/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.2/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
Java程序员-张凯
- 粉丝: 1w+
- 资源: 7529
最新资源
- 基于Java的民宿管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 基于html5的民谣网站的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 3b020汽车配件销售管理系统_springboot+vue.zip
- 3b022投票系统_springboot+vue.zip
- 3b021投稿和稿件处理系统_springboot+vue.zip
- 3b024校园运动会管理系统_springboot+vue0.zip
- 基于html5的网上团购系统设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- APP论坛社区软件源码网站源码APP封装
- 3b023小区疫苗接种管理系统_springboot+vue.zip
- 基于javaEE的校园二手书交易平台的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 基于BS的老年人体检管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 3b025医院挂号系统_springboot+vue.zip
- 3b027自习室座位预约系统_springboot+vue.zip
- 3b028《升学日》日本大学信息及院校推荐网站_springboot+vue0.zip
- 3b026在线学习网站_springboot+vue.zip
- 基于Java的家政服务平台的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈