1. 新建app

startapp your_app_name

2. 删除app

migrate your_app_name zero

此外还需要删除整个App文件夹,并在settings.py的Installed Apps中移除该app。

3. makemigrations 和 migrate

官方解释如下:

migrate, which is responsible for applying and unapplying migrations.
makemigrations, which is responsible for creating new migrations based on the changes you have made to your models.

(原文链接:https://docs.djangoproject.com/en/2.2/topics/migrations/

大致的意思为:

  • makemigrations是将model层转为迁移文件migration
  • migrate将新版本的迁移文件执行,更新数据库。

这两中命令调用默认为全局,即对所有最新更改的model或迁移文件进行操作。如果想对部分app进行操作,就在其后追加app name

4. 创建超级用户

createsuperuser

执行完毕后按照提示输入用户名密码邮箱等信息即可。

最新文章

  1. PHP的serialize序列化数据与JSON格式化数据
  2. Configure custom SSL certificate for RDP on Windows Server 2012 in Remote Administration mode
  3. gulp-less学习教程
  4. Power of Cryptography
  5. 【USACO 1.1.1】你的飞碟在这儿
  6. 解析Xml四种方法
  7. JFileChooser
  8. 对Extjs中时间的多种处理
  9. hibernate简单的增删改查
  10. python列表很聪明,支持负数索引
  11. FJUT寒假第一周作业浮点数查寻题解
  12. 图片纯前端JS压缩的实现
  13. spring面试问题与答案集锦
  14. JavaScript 从入门到放弃(二)模块化工具requirejs
  15. mysql实现简单的增删改查,放入xmapp自带数据库中
  16. Nodejs之路:非I/O的异步API
  17. Android精通教程-第一节Android入门简介
  18. 微信小程序中的组件
  19. 安卓开发笔记——丰富多彩的TextView
  20. golang-test-tool-gotests

热门文章

  1. 01-Spring的概述
  2. go语言下载及安装
  3. Python(二) isinstance
  4. Laravel Vuejs 实战:开发知乎 (2)用户注册
  5. netty(三)---NioEventLoop分析
  6. 【HTML】输入密码访问
  7. hadoop中block副本的放置策略
  8. SpringCloud全家桶学习之一阶段总结(一)
  9. 使用$.ajax时的注意事项
  10. Ubuntu 16.04 安装ROS sudo rosdep init报错问题