Coder Social home page Coder Social logo

django2.0-course's Introduction

Django2.0视频教程的代码

Python Django

该git项目是Django2.0视频教程对应章节的代码,为了查看方便,对应章节代码在对应文件夹中。

Django2.0视频教程地址:https://space.bilibili.com/252028233/#/channel/detail?cid=28138

如何使用

该git项目主要是提供一个可对照的代码给大家。大家一定要先照着视频把代码敲一遍,以加深印象。

每个文件夹对应每节课的代码。

1、Python

Django是Python的一种web框架,需要Python才可使用。本教程使用Python3.6的版本录制,建议使用Python3.x最新版本。可打开Python官网下载并安装。

2、虚拟环境

本课程用virtualenv,你也可以使用其他虚拟环境管理Python库。

3、一键安装库

每次课的代码文件夹都有一个requirments.txt文件。该文件是记录所使用库的信息。可利用该文件直接一键安装所有库。

启动虚拟环境之后(若有使用虚拟环境的的话),进入requirments.txt所在的目录,执行命令:

pip install -r requirements.txt

4、第36节需要安装的mysqlclient库

第36节需要的mysqlclient库先用pip install mysqlclient安装。不行的话,打开https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient下载mysqlclient的whl包,再用pip安装这个whl包。

5、启动本地服务

进入项目根目录,执行命令:

python manage.py runserver

目录大纲

01.什么是Django

  • Django是Python Web框架
  • Django的特点
  • 安装Python3
  • 安装Django2.0
02.入门仪式:Hello World
  • 创建Django项目
  • "Hello, world"
  • 初步介绍urls路由
  • 创建超级管理员,进入后台管理界面
03.Django基本应用结构
  • 什么是Django应用
  • 创建Django应用
  • 初步介绍models模型
  • 模型同步到数据库
  • 简单把模型展现到后台管理界面
04.使用模版显示内容
  • 使用唯一标识访问不同内容
  • 简单处理404异常
  • 使用模板页面
  • get_object_or_404简化代码
  • 创建文章列表页面
  • 初步使用模板标签
  • url路由拆分
(完善中...)

注意

我后面会继续把其他代码和说明补充完整。 admin后台用户名是ysh,密码是test123456

django2.0-course's People

Contributors

haddyyang avatar

Watchers

 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.