Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Python 100 Days | 131,710 | 17 days ago | 680 | Python | ||||||
Python - 100天从新手到大师 | ||||||||||
Django Rest Framework | 25,233 | 24,595 | 1,508 | 2 days ago | 134 | December 15, 2021 | 128 | other | Python | |
Web APIs for Django. 🎸 | ||||||||||
Awesome Django | 6,748 | 18 days ago | 4 | cc0-1.0 | HTML | |||||
A curated list of awesome things related to Django | ||||||||||
Drf Yasg | 3,044 | 290 | 76 | 12 days ago | 59 | October 25, 2020 | 232 | other | Python | |
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code. | ||||||||||
Django Rest Swagger | 2,516 | 2,031 | 41 | 2 years ago | 50 | April 30, 2018 | 168 | bsd-2-clause | Python | |
Swagger Documentation Generator for Django REST Framework: deprecated | ||||||||||
Django Rest Auth | 2,331 | 1,109 | 24 | 8 months ago | 25 | April 01, 2019 | 234 | mit | Python | |
This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON) | ||||||||||
Djoser | 2,228 | 212 | 5 | 18 days ago | 48 | October 30, 2020 | 180 | mit | Python | |
REST implementation of Django authentication system. | ||||||||||
Drf Nested Routers | 1,465 | 621 | 29 | 5 days ago | 19 | October 15, 2021 | 48 | apache-2.0 | Python | |
Nested Routers for Django Rest Framework | ||||||||||
Cookiecutter Django Rest | 1,374 | 20 hours ago | 5 | mit | Python | |||||
Build best practiced apis fast with Python3 | ||||||||||
Drf Extensions | 1,326 | 323 | 14 | 6 months ago | 16 | July 30, 2021 | 74 | mit | Python | |
DRF-extensions is a collection of custom extensions for Django REST Framework |
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] (LennonChin/Blog-Frontend-Project) and the front-end code is implemented using Vue.js + Vue-Router + iView.js.
Python environment: Python 3.6.2
Mainly dependent
Note: For more technical stack dependencies, see the
requirements.txt
file
Back-end project has achieved 19 interfaces, the main function points are as follows:
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.
# 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
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.
> 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.
> 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.
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.py
、highlight.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.
[Apache-2.0] (https://opensource.org/licenses/Apache-2.0)
Copyright (c) 2016-present, LennonChin