DEV Community

Discussion on: Python CRUD Rest API, using: Django, Postgres, Docker and Docker Compose

Collapse
 
alok38 profile image
alok-38 • Edited

Update:

I get the same error even after creating the database and a table in PostgreSQL and running

docker compose build

. Below is the output of

docker compose up

.

 docker compose up
Attaching to db, django_app
db          | 
db          | PostgreSQL Database directory appears to contain a database; Skipping initialization
db          | 
db          | 2023-06-09 11:43:08.562 UTC [1] LOG:  starting PostgreSQL 12.15 (Debian 12.15-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
db          | 2023-06-09 11:43:08.563 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db          | 2023-06-09 11:43:08.563 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db          | 2023-06-09 11:43:08.564 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db          | 2023-06-09 11:43:08.580 UTC [27] LOG:  database system was shut down at 2023-06-09 11:32:17 UTC
db          | 2023-06-09 11:43:08.587 UTC [1] LOG:  database system is ready to accept connections
django_app  | Creating Migrations...
django_app  | Migrations for 'django_app':
django_app  |   django_app/migrations/0001_initial.py
django_app  |     - Create model User
django_app  | ====================================
django_app  | Starting Migrations...
django_app  | Operations to perform:
django_app  |   Apply all migrations: admin, auth, contenttypes, django_app, sessions
django_app  | Running migrations:
django_app  |   No migrations to apply.
django_app  | ====================================
django_app  | Starting Server...
django_app  | Watching for file changes with StatReloader
django_app  | Performing system checks...
django_app  | 
django_app  | System check identified no issues (0 silenced).
django_app  | June 09, 2023 - 11:43:10
django_app  | Django version 3.2.5, using settings 'django_project.settings'
django_app  | Starting development server at http://0.0.0.0:8000/
django_app  | Quit the server with CONTROL-C.
django_app  | Not Found: /
django_app  | [09/Jun/2023 11:43:13] "GET / HTTP/1.1" 404 2171
Enter fullscreen mode Exit fullscreen mode
Collapse
 
francescoxx profile image
Francesco Ciulla

did you manage to solve it?

Collapse
 
alok38 profile image
alok-38

Not yet. If I try this once more and face any issues, I will update.

Thread Thread
 
francescoxx profile image
Francesco Ciulla

ok good luck