Compare commits
35 Commits
psy_branch
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
f9d02a058e | 3 months ago |
|
|
a4949ef7ea | 3 months ago |
|
|
c73b0538c7 | 3 months ago |
|
|
377c5c2b2b | 3 months ago |
|
|
43162d27a3 | 3 months ago |
|
|
f12f581857 | 3 months ago |
|
|
51087a3782 | 3 months ago |
|
|
6a7b51a781 | 3 months ago |
|
|
fbbe9f0585 | 3 months ago |
|
|
ab7cd92010 | 3 months ago |
|
|
fad867dc28 | 3 months ago |
|
|
186c359935 | 3 months ago |
|
|
25a47090e1 | 3 months ago |
|
|
171bb30b8c | 3 months ago |
|
|
0c8dc9e84f | 3 months ago |
|
|
7174e204d4 | 3 months ago |
|
|
c0c78b08c0 | 3 months ago |
|
|
5acc335c22 | 3 months ago |
|
|
b3ee23b29f | 4 months ago |
|
|
85c232d991 | 4 months ago |
|
|
b652fa9a08 | 4 months ago |
|
|
5c366b3c82 | 4 months ago |
|
|
f82823537c | 4 months ago |
|
|
57bd3c3ef1 | 4 months ago |
|
|
f8f5a4fa87 | 4 months ago |
|
|
ed272a2076 | 4 months ago |
|
|
82a328f3db | 4 months ago |
|
|
efa1e69237 | 4 months ago |
|
|
bc3a589743 | 4 months ago |
|
|
1fa113b02d | 4 months ago |
|
|
14e865e94b | 4 months ago |
|
|
aefccf2270 | 4 months ago |
|
|
8b94499a82 | 4 months ago |
|
|
39ff328da5 | 4 months ago |
|
|
3c8a12f23b | 4 months ago |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,18 @@
|
|||||||
# Generated by Django 4.2.7 on 2024-01-26 02:41
|
# Generated by Django 4.2.7 on 2024-01-26 02:41
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models#徐悦然: 导入 Django 迁移模块和模型字段模块,这是所有迁移文件都必需的。
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):#徐悦然: 定义迁移类,所有迁移逻辑都在这个类中。
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('oauth', '0002_alter_oauthconfig_options_alter_oauthuser_options_and_more'),
|
('oauth', '0002_alter_oauthconfig_options_alter_oauthuser_options_and_more'),
|
||||||
]
|
]#徐悦然:它依赖于 oauth 应用中名为 0002_alter_oauthconfig_options_alter_oauthuser_options_and_more 的迁移。这意味着 Django 必须先执行完 0002_... 迁移,才能执行当前这个迁移(假设当前是 0003_...)。这是因为我们要修改的 OAuthUser 模型及其 nickname 字段,正是在之前的迁移(很可能是 0001_initial 或 0002_...)中被创建或最后修改的。
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='oauthuser',
|
model_name='oauthuser',
|
||||||
name='nickname',
|
name='nickname',#徐悦然:它将该字段在 Django Admin 界面等地方显示的名称从之前的 'nickname'(一个单词)修改为了 'nick name'(两个单词,中间有空格)。
|
||||||
field=models.CharField(max_length=50, verbose_name='nick name'),
|
field=models.CharField(max_length=50, verbose_name='nick name'),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
[run]
|
||||||
|
source = .
|
||||||
|
include = *.py
|
||||||
|
omit =
|
||||||
|
*migrations*
|
||||||
|
*tests*
|
||||||
|
*.html
|
||||||
|
*whoosh_cn_backend*
|
||||||
|
*settings.py*
|
||||||
|
*venv*
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
bin/data/
|
||||||
|
# virtualenv
|
||||||
|
venv/
|
||||||
|
collectedstatic/
|
||||||
|
djangoblog/whoosh_index/
|
||||||
|
uploads/
|
||||||
|
settings_production.py
|
||||||
|
*.md
|
||||||
|
docs/
|
||||||
|
logs/
|
||||||
|
static/
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
blog/static/* linguist-vendored
|
||||||
|
*.js linguist-vendored
|
||||||
|
*.css linguist-vendored
|
||||||
|
* text=auto
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.conf text eol=lf
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<!--
|
||||||
|
如果你不认真勾选下面的内容,我可能会直接关闭你的 Issue。
|
||||||
|
提问之前,建议先阅读 https://github.com/ruby-china/How-To-Ask-Questions-The-Smart-Way
|
||||||
|
-->
|
||||||
|
|
||||||
|
**我确定我已经查看了** (标注`[ ]`为`[x]`)
|
||||||
|
|
||||||
|
- [ ] [DjangoBlog的readme](https://github.com/liangliangyy/DjangoBlog/blob/master/README.md)
|
||||||
|
- [ ] [配置说明](https://github.com/liangliangyy/DjangoBlog/blob/master/bin/config.md)
|
||||||
|
- [ ] [其他 Issues](https://github.com/liangliangyy/DjangoBlog/issues)
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
**我要申请** (标注`[ ]`为`[x]`)
|
||||||
|
|
||||||
|
- [ ] BUG 反馈
|
||||||
|
- [ ] 添加新的特性或者功能
|
||||||
|
- [ ] 请求技术支持
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.css'
|
||||||
|
- '**/*.js'
|
||||||
|
- '**/*.yml'
|
||||||
|
- '**/*.txt'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.css'
|
||||||
|
- '**/*.js'
|
||||||
|
- '**/*.yml'
|
||||||
|
- '**/*.txt'
|
||||||
|
schedule:
|
||||||
|
- cron: '30 1 * * 0'
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CodeQL-Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
name: Django CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.css'
|
||||||
|
- '**/*.js'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.css'
|
||||||
|
- '**/*.js'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-normal:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
max-parallel: 4
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10","3.11" ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Start MySQL
|
||||||
|
uses: samin/mysql-action@v1.3
|
||||||
|
with:
|
||||||
|
host port: 3306
|
||||||
|
container port: 3306
|
||||||
|
character set server: utf8mb4
|
||||||
|
collation server: utf8mb4_general_ci
|
||||||
|
mysql version: latest
|
||||||
|
mysql root password: root
|
||||||
|
mysql database: djangoblog
|
||||||
|
mysql user: root
|
||||||
|
mysql password: root
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
cache: 'pip'
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Run Tests
|
||||||
|
env:
|
||||||
|
DJANGO_MYSQL_PASSWORD: root
|
||||||
|
DJANGO_MYSQL_HOST: 127.0.0.1
|
||||||
|
run: |
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py migrate
|
||||||
|
python manage.py test
|
||||||
|
|
||||||
|
build-with-es:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
max-parallel: 4
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10","3.11" ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Start MySQL
|
||||||
|
uses: samin/mysql-action@v1.3
|
||||||
|
with:
|
||||||
|
host port: 3306
|
||||||
|
container port: 3306
|
||||||
|
character set server: utf8mb4
|
||||||
|
collation server: utf8mb4_general_ci
|
||||||
|
mysql version: latest
|
||||||
|
mysql root password: root
|
||||||
|
mysql database: djangoblog
|
||||||
|
mysql user: root
|
||||||
|
mysql password: root
|
||||||
|
|
||||||
|
- name: Configure sysctl limits
|
||||||
|
run: |
|
||||||
|
sudo swapoff -a
|
||||||
|
sudo sysctl -w vm.swappiness=1
|
||||||
|
sudo sysctl -w fs.file-max=262144
|
||||||
|
sudo sysctl -w vm.max_map_count=262144
|
||||||
|
|
||||||
|
- uses: miyataka/elasticsearch-github-actions@1
|
||||||
|
|
||||||
|
with:
|
||||||
|
stack-version: '7.12.1'
|
||||||
|
plugins: 'https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-7.12.1.zip'
|
||||||
|
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
cache: 'pip'
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Run Tests
|
||||||
|
env:
|
||||||
|
DJANGO_MYSQL_PASSWORD: root
|
||||||
|
DJANGO_MYSQL_HOST: 127.0.0.1
|
||||||
|
DJANGO_ELASTICSEARCH_HOST: 127.0.0.1:9200
|
||||||
|
run: |
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py migrate
|
||||||
|
coverage run manage.py test
|
||||||
|
coverage xml
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
tags: djangoblog/djangoblog:dev
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
name: docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.yml'
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'dev'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set env to docker dev tag
|
||||||
|
if: endsWith(github.ref, '/dev')
|
||||||
|
run: |
|
||||||
|
echo "DOCKER_TAG=test" >> $GITHUB_ENV
|
||||||
|
- name: Set env to docker latest tag
|
||||||
|
if: endsWith(github.ref, '/master')
|
||||||
|
run: |
|
||||||
|
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:${{env.DOCKER_TAG}}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
name: publish release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: name/app
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
linux/arm/v7
|
||||||
|
linux/arm/v6
|
||||||
|
linux/386
|
||||||
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:${{ github.event.release.tag_name }}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
env/
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*,cover
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
logs/
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
|
||||||
|
# PyCharm
|
||||||
|
# http://www.jetbrains.com/pycharm/webhelp/project.html
|
||||||
|
.idea
|
||||||
|
.iml
|
||||||
|
static/
|
||||||
|
# virtualenv
|
||||||
|
venv/
|
||||||
|
|
||||||
|
collectedstatic/
|
||||||
|
djangoblog/whoosh_index/
|
||||||
|
google93fd32dbd906620a.html
|
||||||
|
baidu_verify_FlHL7cUyC9.html
|
||||||
|
BingSiteAuth.xml
|
||||||
|
cb9339dbe2ff86a5aa169d28dba5f615.txt
|
||||||
|
werobot_session.*
|
||||||
|
django.jpg
|
||||||
|
uploads/
|
||||||
|
settings_production.py
|
||||||
|
werobot_session.db
|
||||||
|
bin/datas/
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"python-envs.defaultEnvManager": "ms-python.python:system",
|
||||||
|
"python-envs.pythonProjects": []
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
FROM python:3.11
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
WORKDIR /code/djangoblog/
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install default-libmysqlclient-dev gettext -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
ADD requirements.txt requirements.txt
|
||||||
|
RUN pip install --upgrade pip && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt && \
|
||||||
|
pip install --no-cache-dir gunicorn[gevent] && \
|
||||||
|
pip cache purge
|
||||||
|
|
||||||
|
ADD . .
|
||||||
|
RUN chmod +x /code/djangoblog/deploy/entrypoint.sh
|
||||||
|
ENTRYPOINT ["/code/djangoblog/deploy/entrypoint.sh"]
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2025 车亮亮
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue