PacktPublishing / Django-4-by-example

Django 4 by example (4th Edition) published by Packt
https://djangobyexample.com/
MIT License
818 stars 461 forks source link

Chapter 17 , page 684 can't access http://localhost:8000/admin/ #25

Closed PRCervera closed 1 year ago

PRCervera commented 1 year ago

Server (Docker) is not responding requests and don't show any kind of messages.

My project directory is call 'project' instead 'educa'.

Attached DockeFile , docker-compose.yml and settings files... and a screenshot

Could you give me some help?

Thank you !!!

Captura de pantalla 2022-11-29 a las 16 34 24

Archivo comprimido.zip

PRCervera commented 1 year ago

More ...

Attached Docker start log

MacBook-Air-de-Pedro:Educa prc$ docker compose up [+] Running 3/3 ⠿ Network educa_default Created 0.1s ⠿ Container educa-db-1 Created 0.2s ⠿ Container educa-web-1 Created 0.3s Attaching to educa-db-1, educa-web-1 educa-web-1 | wait-for-it.sh: waiting 15 seconds for db:5432 educa-db-1 | educa-db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization educa-db-1 | educa-db-1 | 2022-11-29 16:31:30.317 UTC [1] LOG: starting PostgreSQL 14.5 (Debian 14.5-2.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit educa-db-1 | 2022-11-29 16:31:30.319 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 educa-db-1 | 2022-11-29 16:31:30.319 UTC [1] LOG: listening on IPv6 address "::", port 5432 educa-db-1 | 2022-11-29 16:31:30.387 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" educa-db-1 | 2022-11-29 16:31:30.473 UTC [26] LOG: database system was shut down at 2022-11-29 16:25:11 UTC educa-db-1 | 2022-11-29 16:31:30.601 UTC [1] LOG: database system is ready to accept connections educa-web-1 | wait-for-it.sh: db:5432 is available after 3 seconds educa-web-1 | Performing system checks... educa-web-1 | educa-web-1 | System check identified no issues (0 silenced). educa-web-1 | November 29, 2022 - 16:31:38 educa-web-1 | Django version 4.1.3, using settings 'project.settings.prod' educa-web-1 | Starting ASGI/Channels version 3.0.5 development server at http://0.0.0.0:8000/ educa-web-1 | Quit the server with CONTROL-C.

It seems all it's OK, but ...

Thank you

PRCervera commented 1 year ago

Docker log continue show messages ...

educa-web-1 | System check identified no issues (0 silenced). educa-web-1 | November 29, 2022 - 19:17:30 educa-web-1 | Django version 4.1.3, using settings 'project.settings.prod' educa-web-1 | Starting ASGI/Channels version 3.0.5 development server at http://0.0.0.0:8000/ educa-web-1 | Quit the server with CONTROL-C. educa-db-1 | 2022-11-29 19:40:06.719 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 19:45:06.985 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 19:57:07.541 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 20:02:07.753 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 20:14:08.291 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 20:36:09.372 UTC [127] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 20:56:10.295 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 21:03:10.604 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 21:31:11.750 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 21:48:12.418 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 21:58:12.829 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 22:00:12.918 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 22:22:13.820 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 22:42:14.626 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:26:16.679 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:33:16.979 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:34:17.027 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:36:17.123 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:47:17.560 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:50:17.763 UTC [321] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-29 23:55:17.924 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 00:03:18.271 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 00:06:18.507 UTC [337] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 00:15:18.847 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 01:07:21.185 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 01:31:22.388 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 01:46:23.150 UTC [437] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 02:23:24.820 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 02:49:25.804 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 03:21:27.338 UTC [532] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 03:30:27.669 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 03:41:28.130 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 04:13:29.439 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 04:15:29.491 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 04:25:29.905 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 04:46:30.815 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 04:56:31.362 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 05:15:32.262 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 05:32:33.104 UTC [663] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 05:58:34.007 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 06:03:34.293 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 06:58:37.037 UTC [749] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 07:01:37.072 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 07:10:37.311 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted educa-db-1 | 2022-11-30 07:14:37.450 UTC [31] WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted

Thank you

PRCervera commented 1 year ago

Solved !

In the book, page 682 , ...

ports:

disappear and I remove it.

After in page687 says 'Make sure to remove ports section ...

Thank you !!!