settings.py
TIME_ZONE = 'Asia/Shanghai' 上海时区
INSTALLED_APPS:注册APP
'article',
'password_reset',
'userprofile',
'comment',
TEMPLATES:
'DIRS': [os.path.join(BASE_DIR, 'templates')],:定义模板位置
STATICFILES_DIRS :
os.path.join(BASE_DIR, "static"),:指定静态文件的存放位置
EMAIL_HOST = 'smtp.qq.com'
EMAIL_HOST_USER = 'your_email_account@xxx.com'
EMAIL_HOST_PASSWORD = 'your_password'
EMAIL_PORT = 25
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'xxx的博客 <your_email_account@xxx.com>'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
urls.py
urlpatterns:配置访问路径
path('password-reset/', include('password_reset.urls')),重设密码
path('article/', include('article.urls', namespace = 'article')),文章管理
path('userprofile/', include('userprofile.urls', namespace = 'userprofile')),用户管理
path('comment/', include('comment.urls', namespace='comment')),评论
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT):
上传图片的URL路径
wsgi.py