All Projects → LennonChin → Blogbackendproject

LennonChin / Blogbackendproject

Licence: apache-2.0
Backend code for my blogs, develop with Django Rest framework.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Blogbackendproject

Drf Yasg
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.
Stars: ✭ 2,523 (+1136.76%)
Mutual labels:  rest-api, rest, django, django-rest-framework
Farwest
Framework for building RESTful HATEOAS-driven applications.
Stars: ✭ 18 (-91.18%)
Mutual labels:  rest-api, rest, restful-api, restful
Apidoc
RESTful API 文档生成工具,支持 Go、Java、Swift、JavaScript、Rust、PHP、Python、Typescript、Kotlin 和 Ruby 等大部分语言。
Stars: ✭ 785 (+284.8%)
Mutual labels:  rest-api, rest, restful-api, restful
Codeigniter Jwt Sample
CodeIgniter JWT Sample
Stars: ✭ 144 (-29.41%)
Mutual labels:  rest-api, rest, restful-api, restful
Api Strategy
Equinor API Strategy
Stars: ✭ 56 (-72.55%)
Mutual labels:  rest-api, rest, restful-api, restful
Rest Api Design Guide
NBB's REST-ish API Design Guide
Stars: ✭ 643 (+215.2%)
Mutual labels:  rest-api, rest, restful-api, restful
Gen
Converts a database into gorm structs and RESTful api
Stars: ✭ 825 (+304.41%)
Mutual labels:  rest-api, rest, restful-api, restful
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (+285.78%)
Mutual labels:  rest-api, rest, restful-api, restful
Calm
It is always Calm before a Tornado!
Stars: ✭ 50 (-75.49%)
Mutual labels:  rest-api, rest, restful-api, restful
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-75.98%)
Mutual labels:  rest-api, rest, restful-api, restful
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-28.43%)
Mutual labels:  rest-api, rest, restful-api, restful
The Complete Guide To Drf And Vuejs
📢 Source Code from my Web Dev Course *The Complete Guide To Django REST Framework and Vue JS* (Lang: English & Italian)
Stars: ✭ 78 (-61.76%)
Mutual labels:  rest-api, rest, django, django-rest-framework
Restful Api Design References
RESTful API 设计参考文献列表,可帮助你更加彻底的了解REST风格的接口设计。
Stars: ✭ 4,830 (+2267.65%)
Mutual labels:  rest-api, rest, restful-api, restful
Modern Django
Modern Django: A Guide on How to Deploy Django-based Web Applications in 2017
Stars: ✭ 662 (+224.51%)
Mutual labels:  rest-api, restful-api, django, django-rest-framework
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+24.02%)
Mutual labels:  rest-api, rest, restful-api, restful
Djangorestframework Book
Django REST framework 3 中文文档, API参考, 最佳实践指南
Stars: ✭ 28 (-86.27%)
Mutual labels:  rest-api, restful-api, django, django-rest-framework
Restfm
RESTful web services for FileMaker server.
Stars: ✭ 76 (-62.75%)
Mutual labels:  rest-api, rest, restful-api, restful
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-11.27%)
Mutual labels:  rest-api, rest, restful-api, restful
Koa Restful Boilerplate
Koa 2 RESTful API boilerplate
Stars: ✭ 146 (-28.43%)
Mutual labels:  rest-api, rest, restful
Ssm
👅基于RESTful风格的前后端分离的SSM框架,集成了shiro和swagger等框架
Stars: ✭ 141 (-30.88%)
Mutual labels:  rest-api, rest, restful

Front and back end of the separation of the blog project - back-end projects

Blog has been online, welcome to browse:https://blog.coderap.com/

中文版说明

This repository stores the backend code for blog entries, built using Django and the Django Rest Framework.

Note: The front-end code repository linked to this repository is linked here [Blog-Frontend-Project] (https://github.com/LennonChin/Blog-Frontend-Project) and the front-end code is implemented using Vue.js + Vue-Router + iView.js.

Control Panel effect display

PC Platform

Home Page

Article List Page

Add Article Page

Add Article Page

Mobile Platform

Mobile effect

Overall technology stack

  1. Python environment: Python 3.6.2

  2. Mainly dependent

Note: For more technical stack dependencies, see the requirements.txt file

Implemented basic functions

Back-end project has achieved 19 interfaces, the main function points are as follows:

  1. The realization of the three sections: articles, atlas and photography, respectively, corresponding to the three different modes of presentation; at the same time to achieve time-axis archiving section;
  2. Implementation of the management console in the three sections of the article's release, you can publish Markdown format article (using EditorMD editor); 3 comment function, the current method is to use the nickname + email, the first comment will verify the mailbox (by sending a verification code);
  3. Achieve the article encryption function;
  4. Implementation of the seven cattle cloud storage services docking, publishing reviews and other operations will upload the image data to the seven Niuniu; currently does not provide the corresponding services within the project, such as the need to docking please buy seven Niuniu storage object services;

Note: The xadmin, EditorMD and other plug-ins used in the project are developed for the second time. In order to cooperate with the project-specific functions, please do not change the plug-in easily.

Next will be achieved

  1. Access GitHub, WeChat, Weibo, Facebook and other third-party login comments.
  2. Add more columns.

How to use

  1. Clone this project
  2. local installation of Python3 and pip environment;
  3. After installing the virtualenv and virtualenvwrapper environment, execute the following command to create a virtual environment:
# Create a workspace
> mkvirtualenv BlogBackend
# Activate the workspace
> workon BlogBackend
# Change to the root directory of this project, Install dependencies
> pip install -r requirements.txt
  1. Next, if you are using PyCharm as a development environment, modify its Project Interpreter to workspace we made above.
  2. In this project, sensitive account information is not provided, but stored in private.py file, this file is not managed to the warehouse, so you need to create a private.py file in the same level setting.py file Document, which reads as follows:
#! / usr / bin / python3
# - * - coding: utf-8 - * -
# @Time: 2017/12/29 6:01 PM
# @Author: LennonChin
# @Email: [email protected]
# @File: private.py
# @Software: PyCharm

# Site Secret Key,it is a copy of settings.py file's SECRET_KEY option
PRIVATE_SECRET_KEY = ''

# Database connection configuration
DATABASE_CONFIG = {
    'ENGINE': '', # Database Engine
    'NAME': '', # database name used in the database
    "USER": '', # database user name
    "PASSWORD": '', # database password
    "HOST": '', # database address
    'PORT': 3306, # database access port,MySQL is 3306 default
    'OPTIONS': {
        "init_command": "SET default_storage_engine = INNODB;",
    }
}

# Send mail server configuration
EMAIL_CONFIG = {
    'EMAIL_HOST': "", # mail server address
    'EMAIL_PORT': 25, # mail server port, usually 25
    'EMAIL_HOST_USER': "", # mail server account
    'EMAIL_HOST_PASSWORD': "", # mail server password
    'EMAIL_USE_TLS': False, # Whether to use TLS encryption connection, generally not used
    'EMAIL_FROM': "" # This item is generally the same as EMAIL_HOST
}

# Qiniu Yun related configuration
PRIVATE_QINIU_ACCESS_KEY = '' # Qiniu Access key
PRIVATE_QINIU_SECRET_KEY = '' # Qiniu Secret key
PRIVATE_QINIU_BUCKET_DOMAIN = '' # Qiniu Bucket domain
PRIVATE_QINIU_BUCKET_NAME = '' # Qiniu name

PRIVATE_MEDIA_URL_PREFIX = '' # Resource prefix used when accessing Cattle Cloud
PRIVATE_SITE_BASE_URL = '' # Site URL, for example as you site access domain

The SECRET_KEY(PRIVATE_SECRET_KEY)above is a key that generated by django, we can also generate it by myself, generate way as follow:

In [1]: from django.core.management import utils

In [2]: utils.get_random_secret_key()
Out[2]: '7%x-f2u#@[email protected]$q(=_yauzx8i4$8u&5epa=w^[email protected]+!r1'

SECRET_KEY is auto generated by django when we start a project, the way use code above, you can read the source code for details.

  1. Configure the above configs, use the following command to migrate the table:
> python manage.py makemigrations
> python manage.py migrate

Note: If the migration fails, you can migrate by user, material, base, user_operation, index and remaining modules in that order.

  1. Then start the project directly use the following command:
> python manage.py runserver 127.0.0.1:8000

By default, if you run the evelopment Server after running '127.0.0.1: 8000, the provided interface is at http://127.0.0.1:8000/api, background management address http://127.0.0.1: 8000/xadmin.

At the same time, if you want the front-end to access the back-end interface, you need to fill in the site information in the back-end of the basic configuration - Web site configuration, the most important thing is to fill in the API interface BaseURL entry for your front-end page to access the interface API.

Others

In this project, I use Pygments and pymdownx to process markdown convert, and I expand these two third-party plugins, the expanded code saved at path apps/utils/HTMLFormatter, and there is a test file you can experiment. If you want to use these two super expandations, you need two steps. First, copy superfences.pyhighlight.py to your project virtual environment, overwrite the file of pymdownx, just as my project virtual environment named BlogBackend, and it's path is virtualEnvs/BlogBackend/lib/python3.6/site-packages/pymdownx. Then you need to rename apps/utils/HTMLFormatter/code.py to apps/utils/HTMLFormatter/html.py in these project, and copy the renamed file to your project virtual environment, overwrite the source code files of pygments, just as the path of my project's virtual environment is virtualEnvs/BlogBackend/lib/python3.6/site-packages/pygments/formatters.

If you feel the steps above is complex, you can also run project directly, but cannot use the expanded markdown convert syntaxes, example page: Expand Markdown syntax of this website.

License

[Apache-2.0] (https://opensource.org/licenses/Apache-2.0)

Copyright (c) 2016-present, LennonChin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].