0 x00 preface

Writing in the front: Sorry, the title is so vulgar that it has a tacky name.

This is the directory for a series of tutorials on my full-stack Django open source project.

Why write this series of articles? The purpose is generally twofold:

  1. First, I hope that more people will have a better understanding of Django development stack or Web development stack through this series of tutorials, so that more Pythonist can enter the world of Django development more smoothly.
  2. Django/DjangoRestFramework/Docker/ue.JS/Celery/PostgreSQL/Redis / RabbitMQ

Why is this one you can’t miss?

  • New! New! New! Keep up to date software development version, Django 2.0 + Vue.JS 2.5 + PostgreSQL 10 + Celery 4.1.0
  • Django Framework: Django and its powerful ecosystem
  • Back-end components: PostgreSQL RabbitMQ Redis Ngnix
  • Front-end technology: single-page application front-end and back-end separation (VueJS+Webpack+DjangoRestFramework), automatic deployment
  • Django Community Best Practices: The latest DevOps thinking from the configuration/development/test/Deployment Full Stuff Engineer.
  • It basically covers all the components and operations needed for advanced Django development.
  • With the right adjustments, this project can be the perfect scaffold for your new project.

For readers of this series:

  • The target is Pythonist of DevOps
  • Pythonist who likes to be a fiddler
  • Practitioners of front and back end separation

Life is short. Get in the car

Life is Short , I Use Python

0x01 Project Description

YaDjangoBlog is another blog wheel, but its ambition is not just to build another blogging system, but to do best practices for full-stack Django development through this project.

1.1 Project Address

  • Front-end code github.com/twocucao/Ya…
  • Back end code github.com/twocucao/Ya…

1.2 Project technology stack

  • The development and deployment environment is Docker
  • Python 3.5.2
  • Front-end Vue + Webpack + ES2015 + AXIOS
  • Backend Django 2.0 + DjangoRestFramework + Celery
  • Use tools Ansible and Docker for automated deployment
  • The backend components
    • ElasticSearch is used for searching and recommending
    • PostgreSQL is used for data persistence
    • Redis is used for Session/and caching
    • RabbitMQ Distributed queue/scheduled task
    • Nginx is used for reverse proxies

1.3 Special Thanks

  • Ansible django stack: github.com/jcalazan/an…
  • Cookiecutter – django: github.com/pydanny/coo…
  • Djangopackages: github.com/djangopacka…
  • ElasticSearch www.dongwm.com/archives/%E…
  • The developers of the components
    • ElasticSearch
    • PostgreSQL
    • Redis
    • RabbitMQ
    • Nginx
    • Docker

1.4 Project Screenshot

Well, after a long talk, I’d better post some pictures, after all, I’m not a Markdown programmer

Let’s look at the visible front end first

The home page


Details on the blog



This is a normal Archive page


This is Elasticsearch supported search


Django comes with a backend


How can the front and back end separation be removed from the rest API implementation and easy front-end debugging?



Django Debug Tools helps you tune your interface quickly


Let’s first look at the visible development interface

To start all tasks automatically, run tmuxinator start yavueblog on the terminal

Front running state



Back-end running status




Of course, you can check the health of the component directly by connecting the client to the corresponding service



0x02 series tutorial directory

2.1 Tutorial notes

  1. The configuration of the development environment in this article is limited to macOS only, if you are using Windows/you may need to configure the environment yourself. However, the author used Docker to configure the environment, which should save a lot of trouble.
  2. Before reading this tutorial, please follow the official Django tutorial at least once. Don’t mess around with nothing.
  3. If there is a problem during use, please provide as much information as possible in the ISSUE to clearly describe the problem.

This series of tutorials is not written as a step-by-step code addition.

I will first set up the framework of the whole project and then introduce the project from different perspectives, such as:

  1. How is the Models for a module designed? What a way to write code.
  2. How does Django User extend Django? Also in djangos ecosphere, there are packages worth looking at, such as the Guardian
  3. How should a Restful API be written? How should a Rest API in Django be written? What are the use methods for improving Guangguangguang’s production efficiency? How do I do permissions? What about limiting the current?
  4. Py. Test TDD test driven development
  5. Elegant single terminal multi open using reasonable tools like Tmux.

2.2 Tutorial Contents

  • Django Full Stack Development Tutorial – Django Full Stack Projects not to be missed in 2018
  • Django Full Stack Development Tutorial – YaDjangoBlog development Environment configuration
  • Django Full Stack Development Tutorial – Preliminary design of front and back ends for YaDjangoBlog
  • Django Full Stack Development Tutorial – YaDjangoBlog’s front and back end separation
  • Django Full Stack Development Tutorial – a preliminary back-end implementation of YaDjangoBlog
  • Django full Stack Development Tutorial – YaDjangoBlog front-end implementation of YaVueBlog
  • Django Full Stack Development Tutorial – YaDjangoBlog’s back-end component Redis
  • Django Full Stack Development Tutorial – YaDjangoBlog’s backend component PostgreSQL
  • Django Full Stack Development Tutorial – YaDjangoBlog backend component Elasticsearch
  • Django Full Stack Development Tutorial – YaDjangoBlog’s back-end component RabbitMQ
  • Django Full Stack Development Tutorial – YaDjangoBlog production Deployment

0xEE. Reference link

This article will be updated over time, and the updated tutorials will be noted in the ChangeLog section of this article.

Why are you hesitating? Get in the car

  • Front-end code github.com/twocucao/Ya…
  • Back end code github.com/twocucao/Ya…

ChangeLog:

  • 2018-02-21 Revised text
  • 2018-02-22 Fine tuning text, update the first environment configuration