Git Product home page Git Product logo

django_learn_project's Introduction

命令

  1. 创建django项目
django-admin startproject 项目名
  1. 创建超级管理员
python manage.py migrate
python manage.py createsuperuser
python manage.py makemigrations
# 添加项目到settings.py中的INSTALLED_APPS中去
python manage.py migrate

学习笔记

  1. 设置django的后台显示为中文

settings.py中的 LANGUAGE_CODE = 'zh-Hans'

工作日志

  1. 添加type模型
  2. 添加novel模型
  3. 启动本地数据库并添加超级管理员

账号: admin 密码: [email protected]

  1. 将添加的模型注册到后台管理中去

  2. 设置django的后台显示为中文

  3. 上传图片配置

  4. 添加章节模型

    • 富文本编辑器

    pip install django-ckeditor

    • 设置软删除
  5. 添加公告模型

  6. 设置网站后台管理的名称

  7. 设置列表标题显示

  8. 设置系统首页的各种管理

  9. 设置前台有关的操作的函数

  10. 设置前台模板

  11. 定义首页

from * import * 直接用

  1. 登录API

user.is_authenticated 判断是否登录 需要在views中注入user

  1. 模板继承

  2. 静态资源文件加载

  3. 通知公告

  4. 分类

  5. 分类查询

技术攻关

  1. 集成富文本编辑器
  1. 上传图片
  1. 增加编辑操作

admin.py list_display_links属性设置

  1. 数据表软删除
  1. django后台自定义设置
  1. 在models.py中设置默认添加人为当前的添加人,不需要再进行选择

  2. 设置admin后台表名称和字段显示中文

  1. 富文本不转义
  1. 模板url传参
  1. 上一章下一章设置
  1. 系统登录
  1. 静态资源文件
  1. 循环序号
  1. 用户登录

  2. 聚合查询

  1. 模糊查询
  1. 控制器中判断是否登录

参考链接

参考项目

未完

  • 后台小说菜单增加章节管理

django_learn_project's People

Contributors

rwqzcq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.