Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update postgres initialization for compose/django.md #10624

Merged
merged 2 commits into from
Apr 16, 2020

Conversation

snoop2head
Copy link
Contributor

Proposed changes

Updated postgres initialization for compose/django.md

Related issues

Issue #10532 django quickstart fail "Database is uninitialized and superuser password is not specified."

@netlify
Copy link

netlify bot commented Apr 12, 2020

Deploy preview for docsdocker ready!

Built with commit 920975c

https://deploy-preview-10624--docsdocker.netlify.app

@usha-mandya usha-mandya added the area/compose Relates to docker-compose.yml spec or docker-compose binary label Apr 14, 2020
@usha-mandya
Copy link
Member

Thank you for the update, @snoop2head.

@ulyssessouza Could you PTAL?

services:
db:
image: postgres
ports: #add line.
Copy link
Contributor

@ulyssessouza ulyssessouza Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block can be omitted. The port is not exposed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked! Yes it can be omitted

- "8000:8000"
depends_on:
- db
# docker-compose.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove this comment line. The previous steps already mention the filename.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'postgres', #add line.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove the comment "#add line" from it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger

Copy link
Contributor

@ulyssessouza ulyssessouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes on comments and an extra block

@usha-mandya
Copy link
Member

Thank you @ulyssessouza.

@snoop2head Could you address the feedback from Ulysses? Thanks.

@snoop2head
Copy link
Contributor Author

snoop2head commented Apr 15, 2020

@ulyssessouza @usha-mandya
Thank you for the feedback!
I updated the instruction .md file accordingly.

  • Omitted comments with file names & "add lines"
  • Deleted uncompleted postgres port exposure code block

After making changes, I ran the django tutorial from the beginning.
Django server is working fine, with the following console log:

db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1   | 
db_1   | 2020-04-15 17:06:40.956 UTC [1] LOG:  starting PostgreSQL 12.2 (Debian 12.2-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2020-04-15 17:06:40.957 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2020-04-15 17:06:40.957 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2020-04-15 17:06:40.959 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2020-04-15 17:06:40.972 UTC [26] LOG:  database system was shut down at 2020-04-15 17:06:38 UTC
db_1   | 2020-04-15 17:06:40.976 UTC [1] LOG:  database system is ready to accept connections
web_1  | Watching for file changes with StatReloader
web_1  | Performing system checks...
web_1  | 
web_1  | System check identified no issues (0 silenced).
web_1  | 
web_1  | You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
web_1  | Run 'python manage.py migrate' to apply them.
web_1  | April 15, 2020 - 17:06:41
web_1  | Django version 2.2.12, using settings 'composeexample.settings'
web_1  | Starting development server at http://0.0.0.0:8000/
web_1  | Quit the server with CONTROL-C.

Copy link
Member

@usha-mandya usha-mandya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @snoop2head . The updates look good.

@usha-mandya usha-mandya merged commit c36fb45 into docker:master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/compose Relates to docker-compose.yml spec or docker-compose binary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants