Giter Club home page Giter Club logo

django-blog-project's Introduction

Django blog project

django blog screenshot

相关资源

在线预览

用户使用手册

特性一览

  • 简约优雅的 UI,移动端优先的响应式设计。
  • Webpack 前端资源打包。
  • 基于 Vue 的多级评论系统。
  • 文章、评论内容支持 Markdown 与代码高亮。
  • 支持 GitHub、新浪微博社交账户登录。
  • 中文全文搜索,关键词高亮。
  • 完善的通知系统,评论、回复博客内通知,同时邮件提醒。
  • 独有的教程系统,方便地管理系列文章。
  • Docker 部署,无痛上线。

部署上线

  1. 安装 Docker 和 Docker Compose。

  2. 克隆代码到线上服务器

    $ git clone https://github.com/zmrenwu/django-blog-project
  3. 创建项目所需的环境变量文件,在项目根目录创建名为 .envs 的文件夹,并在 .envs 下创建 .production 文件,写入如下内容

    SECRET_KEY=your-own-secret-key
    DJANGO_SETTINGS_MODULE=config.settings.production
    DJANGO_SENDGRID_API_KEY=your-own-sendgrid-api-key
    # 设置允许访问的 HOSTS,逗号分隔
    DJANGO_ALLOWED_HOSTS=your-domain.com,www.yourdomain.com
    # 设置管理员邮箱,用于接收邮件通知提醒
    DJANGO_ADMINS=zmrenwu <[email protected]>
    [email protected]
    

    SECRET_KEY:项目密钥,推荐使用 Django Secret Key Generator 自动生成。

    DJANGO_SENDGRID_API_KEYSendGrid 邮件发送密钥,配置后才能发送邮件提醒。

  4. 复制 compose/production/nginx/conf.d/blogproject.conf-tmpl 到同级目录(即 conf.d 下),重命名为 blogproject.conf,将 blogproject.conf 中的 xxx.com 替换为你自己的域名。

  5. 进入项目根目录,启动 Docker 容器

    $ docker-compose -f production.yml up --build -d
  6. 开启 HTTPS

    $ docker exec -it blogproject_nginx certbot --nginx -n --agree-tos --redirect --email [email protected] -d your-domain.com,www.your-domain.com

    解释下关键参数的含义:

    --redirect:自动将所有 HTTP 请求重定向为 HTTPS 请求。

    --email:你的 email,用于接收 letsencrypt 的消息提醒。

    -d:后跟需要配置 HTTPS 证书的域名列表,以逗号分隔。

  7. 创建后台管理员账户

    $ docker exec -it blogproject python manage.py createsuperuser
  8. Over~~

本地运行

  1. 安装 Docker 和 Docker Compose。

  2. 克隆代码到本地

    $ git clone https://github.com/zmrenwu/django-blog-project
  3. 进入项目根目录,启动 Docker 容器

    $ docker-compose -f local.yml up --build
  4. 进入 frontend 目录,启动静态文件服务器

    $ npm install
    $ npm run dev
  5. Over~~

新功能开发路线图

详见:django-blog-project 版本规划与新功能开发路线图

版本迭代历史

详见:django-blog-project 版本迭代历史记录

django-blog-project's People

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.