1 Star 0 Fork 0

gong2020 / Blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 880 Bytes
一键复制 编辑 原始数据 按行查看 历史
Skedush 提交于 2021-05-24 23:01 . feat(new-project-upload): fist upload

Blog

基于 django rest framework 博客系统的后台 api


安装依赖

$pip install -r Blog/requriements.txt

项目配置修改

  1. 在 setting/commom 中修改数据库信息
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',  # 使用的引擎,需要安装 PyMySQL 包
        'NAME': 'blog',  # 连接数据库的名称
        'USER': 'root',  # 连接数据库的用户名
        'PASSWORD': 'root',  # 连接数据库的密码
        'HOST': '127.0.0.1',  # 连接数据库的地址
        'PORT': '3306',  # 连接数据库的端口
    }
}
  1. 创建数据库与 NAME 指定的一样

  2. 执行数据库初始化命令

由于数据库迁移文件已经上传,直接执行:

$python manage.py migrate

项目启动

$python manage.py runserver --setting=Blog.settings.dev
1
https://gitee.com/gong2020/Blog.git
git@gitee.com:gong2020/Blog.git
gong2020
Blog
Blog
main

搜索帮助