• Stars
    star
    2,351
  • Rank 19,465 (Top 0.4 %)
  • Language
    CSS
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

基于 Python3.5 和 Django 1.10 的 Django Blog 项目。

第二版已发布!第二版已发布!第二版已发布!

Django博客教程第二版全面升级,带来以下新特性,帮助初学者更好地学习 django:

  1. 基于最新版 django 2.2
  2. Pipenv 无痛管理虚拟环境和依赖
  3. 更加简单无痛苦的部署流程,几条命令快速上线,一键脚本无痛更新
  4. 开启 HTTPS 新时代
  5. Elasticsearch 全文搜索

强烈不再建议学习旧版,第二版教程戳下面直达:

PS:

Django 全栈计划已启动,戳 这里 了解详情,感兴趣的童鞋请持续关注我的博客:追梦人物的博客


免费、中文、零基础,完整的项目,基于最新版 Django 1.10 和 Python 3.5。带你从零开始一步步开发属于自己的博客网站,帮助你以最快的速度掌握 Django 开发的技巧。

资源列表

分支说明

每篇教程的代码都位于项目相应的分支中,点击上方的 Branch 按钮可以查看到,例如分支 Step1_build-development-environment 对应第 1 篇教程 1 - 搭建开发环境

master 主分支是项目的完整代码。

demo 分支是演示项目的分支代码。

在本地运行项目

  1. 克隆项目到本地

    打开命令行,进入到保存项目的文件夹,输入如下命令:

    git clone https://github.com/zmrenwu/django-blog-tutorial.git
    
  2. 创建并激活虚拟环境

    在命令行进入到保存虚拟环境的文件夹,输入如下命令创建并激活虚拟环境:

    virtualenv blogproject_env
    
    # windows
    blogproject_env\Scripts\activate
    
    # linux
    source blogproject_env/bin/activate
    

    关于如何使用虚拟环境,参阅:搭建开发环境 的 Virtualenv 部分。如果不想使用虚拟环境,可以跳过这一步。

  3. 安装项目依赖

    如果使用了虚拟环境,确保激活并进入了虚拟环境,在命令行进入项目所在的 django-blog-tutorial 文件夹,运行如下命令:

    pip install -r requirements.txt
    
  4. 迁移数据库

    在上一步所在的位置运行如下命令迁移数据库:

    python manage.py migrate
    
  5. 创建后台管理员账户

    在上一步所在的位置运行如下命令创建后台管理员账户

    python manage.py createsuperuser
    

    具体请参阅 在 Django Admin 后台发布文章

  6. 运行开发服务器

    在上一步所在的位置运行如下命令开启开发服务器:

    python manage.py runserver
    

    在浏览器输入:127.0.0.1:8000

  7. 进入后台发布文章

    在浏览器输入:127.0.0.1:8000/admin

    使用第 5 步创建的后台管理员账户登录

    具体请参阅 在 Django Admin 后台发布文章

教程目录索引

基础部分

进阶部分

交流讨论和继续学习 Django

这里汇聚了大量经验丰富的 Django 开发者,遇到问题随时请教,以及获取更多的 Django 学习资料。

More Repositories

1

django-blog-tutorial-templates

一套简洁但优雅的 HTML 博客模板
CSS
411
star
2

django-blog-project

基于 django 和 Vue 的个人博客。
Python
192
star
3

pythonzh.cn

为 Python 交流学习搭建的社区,使用 django1.10 和 Python3.5 强力驱动。
HTML
186
star
4

django-auth-example

Django 登录、注册等用户认证示例。
Python
87
star
5

django-mptt-comments

拓展 django 官方评论库,提供无限层级的评论支持
Python
36
star
6

vue2.x-todo-tutorial

基于 Vue 2.x 开发的待办事项应用,包含一套详细的开发教程。
HTML
28
star
7

Cpp-Primer-Plus-6th-exercises

《C++ Primer Plus》(第六版)编程练习题参考答案。
C++
18
star
8

gopl-exercises

《Go 程序设计语言》练习题参考答案。
Go
5
star
9

react-bootstrap-toasts

Dynamically create react-bootstrap toasts via a simple api.
TypeScript
5
star
10

myfeeds

抓取微博用户最新动态、B站UP主最新投稿、优酷作者最新视频并推送微信,使用 Python asyncio 实现。
Python
4
star
11

show-me-the-code-go

Show me the code, go 语言版, 一起来学 go~ 🏃‍♀️
Go
3
star
12

django-tree-comments

A django library for building comments in tree structure.
Python
3
star
13

django-tencentcos-storage

A django app for Tencent Cloud Object Storage. 腾讯云对象存储(COS)服务 for Django。
Python
3
star
14

django-huey-email

Asynchronous Email Backend for Django with Huey.
Python
2
star
15

dream-blog

追梦人物的博客
Python
1
star
16

django-dream-blog

A dream blog built with Django.
Python
1
star
17

leetcode-rust-solutions

LeetCode Rust 题解。包含对官方解题思路的进一步说明和算法正确性的证明。
1
star
18

react-tic-tac-toe

tic-tac-toe game source code in React official tutorial plus typescript, lint, testing and solution to improvements.
TypeScript
1
star