1、克隆仓库https://gitee.com/lylinux/DjangoBlog.git
若失效:https://gitee.com/usutdzxy/DjangoBlog.git
2、环境安装
pip install -Ur requirements.txt
3、修改djangoblog/setting.py 修改数据库配置,其他的步骤就按照官方文档。
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql','NAME': 'djangoblog','USER': 'root','PASSWORD': 'root','HOST': '127.0.0.1','PORT': 3306,}}
4、可能会出现的问题:
【error】Database returned an invalid datetime value. Are time zone definitions for your database inst
修改:
参考:https://codeleading.com/article/78832425719/
修改settings.py中时间信息的配置:
# LANGUAGE_CODE = 'en-us'
# TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'USE_I18N = TrueUSE_L10N = True#USE_TZ = True
USE_TZ = False