"""
Django settings for d1 project.
Generated by 'django-admin startproject' using Django 3.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/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/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'z@o^r_pnxxwar)i0ssb&aekc#ava93a(cn4)3@3!gzu0sf!qj1'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'poll.apps.PollConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
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 = 'd1.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 = 'd1.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
# python自带的一个数据库,基本不会被使用
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# 注册我们自己使用的数据库连接
'ENGINE': 'django.db.backends.mysql', # 数据库引擎
'NAME': 'django', # 数据库名称
'USER': 'django', # 连接数据库的用户名称
'PASSWORD': 'localhost', # 用户密码
'HOST': 'localhost', # 访问的数据库的主机的ip地址
'PORT': '3306', # 默认mysql访问端口
}
}
# Password validation
# https://docs.djangoproject.com/en/3.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/3.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 Python毕业设计-基于Django的投票系统的设计与实现+使用说明+全部资料(优秀项目).zipPython毕业设计-基于Django的投票系统的设计与实现+使用说明+全部资料(优秀项目).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕设项目、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 3、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
Python毕业设计-基于Django框架的投票系统的设计与实现+使用说明+全部资料(优秀项目).zip (33个子文件)
voteSystem-main
.gitattributes 66B
poll
__init__.py 0B
tests.py 60B
admin.py 538B
migrations
__init__.py 0B
0001_initial.py 1KB
__pycache__
0001_initial.cpython-37.pyc 986B
__init__.cpython-37.pyc 148B
apps.py 83B
models.py 465B
templates
poll
detail.html 475B
index.html 488B
results.html 299B
urls.py 345B
__pycache__
views.cpython-37.pyc 2KB
admin.cpython-37.pyc 804B
models.cpython-37.pyc 882B
__init__.cpython-37.pyc 137B
apps.cpython-37.pyc 349B
urls.cpython-37.pyc 471B
views.py 2KB
templates
admin.html 0B
d1
__init__.py 89B
wsgi.py 381B
urls.py 794B
settings.py 4KB
__pycache__
settings.cpython-37.pyc 2KB
__init__.cpython-37.pyc 235B
wsgi.cpython-37.pyc 528B
urls.cpython-37.pyc 955B
asgi.py 381B
__pycache__
manage.cpython-37.pyc 803B
171265889347208773632.zip 416B
共 33 条
- 1
资源评论
不走小道
- 粉丝: 3232
- 资源: 5113
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功