Use latest version tools

This commit is contained in:
Baohua Yang
2026-01-12 09:02:39 -08:00
parent 43e12058eb
commit 24eb615f54
15 changed files with 49 additions and 56 deletions

View File

@@ -23,8 +23,8 @@ COPY . /code/
第二步 `requirements.txt` 文件里面写明需要安装的具体依赖包名
```bash
Django>=2.0,<3.0
psycopg2>=2.7,<3.0
Django>=4.0,<5.0
psycopg2-binary>=2.9,<3.0
```
第三步`docker-compose.yml` 文件将把所有的东西关联起来它描述了应用的构成一个 web 服务和一个数据库使用的 Docker 镜像镜像之间的连接挂载到容器的卷以及服务开放的端口
@@ -105,8 +105,8 @@ web_1 | Performing system checks...
web_1 |
web_1 | System check identified no issues (0 silenced).
web_1 |
web_1 | November 23, 2017 - 06:21:19
web_1 | Django version 1.11.7, using settings 'django_example.settings'
web_1 | November 23, 2024 - 06:21:19
web_1 | Django version 4.2, using settings 'django_example.settings'
web_1 | Starting development server at http://0.0.0.0:8000/
web_1 | Quit the server with CONTROL-C.
```
@@ -116,5 +116,5 @@ web_1 | Quit the server with CONTROL-C.
你还可以在 Docker 上运行其它的管理命令例如对于同步数据库结构这种事在运行完 `docker compose up` 在另外一个终端进入文件夹运行以下命令即可
```bash
$ docker compose run web python manage.py syncdb
$ docker compose run web python manage.py migrate
```