Skip to content

Commit 2244f35

Browse files
committed
fix: 回退后端版本对应shell版本
1 parent 7772d99 commit 2244f35

174 files changed

Lines changed: 1538 additions & 3976 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
backend:
3+
image: webvirtbackend:dev
4+
hostname: backend
5+
ports:
6+
- 8000:8000
7+
- 127.0.0.1:5678:5678
8+
volumes:
9+
- .:/app
10+
command: ["sh", "-c", "python3 -m pip install debugpy && python3 -m debugpy --wait-for-client --listen 0.0.0.0:5678 manage.py runserver 0.0.0.0:8000 --nothreading --noreload"]
11+
environment:
12+
DB_HOST: mariadb
13+
DB_PORT: 3306
14+
DB_NAME: webvirtcloud
15+
DB_USER: django
16+
DB_PASSWORD: django
17+
PYTHONOPTIMIZE: 1
18+
ANSIBLE_HOST_KEY_CHECKING: 0
19+
ANSIBLE_PARAMIKO_LOOK_FOR_KEYS: 0
20+
DJANGO_SETTINGS_MODULE: webvirtcloud.settings.develop
21+
CELERY_BROKER_URL: "amqp://guest:guest@rabbitmq:5672"
22+
depends_on:
23+
- mariadb
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "Existing Docker Compose (Extend)",
3+
"dockerComposeFile": [
4+
"../docker-compose.yml",
5+
"backend.yml"
6+
],
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-python.isort",
11+
"ms-python.python",
12+
"GitHub.copilot"
13+
]
14+
}
15+
},
16+
"service": "backend",
17+
"workspaceFolder": "/app"
18+
}

webvirtbackend/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E501, W503, E203
2+
ignore = E203, E501, W503
33
exclude =
44
.git,
55
.venv,

webvirtbackend/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ __pycache__/
1313
# Database data
1414
.mysql
1515

16-
# IDE
17-
.idea/
18-
1916
# Distribution / packaging
2017
.Python
2118
build/

webvirtbackend/.ruff.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"[python]": {
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "ms-python.black-formatter"
5+
},
6+
"python.linting.enabled": true,
7+
"python.linting.flake8Enabled": true,
8+
"python.linting.pylintEnabled": false,
9+
"python.formatting.provider": "black",
10+
"python.linting.flake8Args": [
11+
"--max-line-length=120",
12+
"--ignore=E203,E501,W503"
13+
],
14+
}

webvirtbackend/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ cd webvirtcloud/webvirtbackend/
2828
docker compose build
2929
```
3030

31-
Push to hub
32-
33-
```bash
34-
docker tag webvirtbackend:dev spiritlhl/webvirtbackend:dev
35-
docker push spiritlhl/webvirtbackend:dev
36-
```
37-
3831
4. Run the Docker container:
3932
```bash
4033
docker compose up -d
@@ -47,8 +40,7 @@ docker compose exec backend python3 manage.py migrate
4740

4841
6. Load the initial data:
4942
```bash
50-
docker compose exec backend python3 manage.py sync_fixtures --dry-run
51-
docker compose exec backend python3 manage.py sync_fixtures
43+
docker compose exec backend python3 manage.py loaddata initial_data
5244
```
5345

5446
7. Load admin user:

webvirtbackend/account/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import binascii
21
import os
2+
import binascii
33
from uuid import uuid4
44

5-
from django.conf import settings
6-
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
75
from django.db import models
6+
from django.conf import settings
87
from django.utils import timezone
98
from django.utils.crypto import get_random_string
9+
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
1010

1111

1212
class UserManager(BaseUserManager):

webvirtbackend/account/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from django.contrib.auth import authenticate
21
from rest_framework import serializers
2+
from django.contrib.auth import authenticate
33

4-
from .models import Token, User
4+
from .models import User, Token
55
from .tasks import email_confirm_register
66

77

0 commit comments

Comments
 (0)