GithubHelp home page GithubHelp logo

postgres .env about dockerizing-django HOT 8 CLOSED

realpython avatar realpython commented on September 28, 2024
postgres .env

from dockerizing-django.

Comments (8)

mjhea0 avatar mjhea0 commented on September 28, 2024 3

Make sure you rebuild the containers. You could also create the role manually with a sql script that is added to the entrypoint folder: https://stackoverflow.com/questions/26598738/how-to-create-user-database-in-script-for-docker-postgres

from dockerizing-django.

mjhea0 avatar mjhea0 commented on September 28, 2024

You will need to create the role before doing anything else. After the container is spun up, before you apply the migrations you will need to create the role.

https://github.com/realpython/flask-microservices-main/blob/master/docker-compose.yml#L11

from dockerizing-django.

AliYmn avatar AliYmn commented on September 28, 2024

Is it true?
https://gist.github.com/AliYmn/ce4e3075090a05753d9df328a0155fe1#file-docker-compose-yml-L33

Do I have to do something else?

from dockerizing-django.

mjhea0 avatar mjhea0 commented on September 28, 2024

Change it to match the username and password you're using in your .env file.

from dockerizing-django.

AliYmn avatar AliYmn commented on September 28, 2024

docker-compose.yml ;
https://gist.github.com/AliYmn/ce4e3075090a05753d9df328a0155fe1#file-docker-compose-yml-L34

.env file;
https://gist.github.com/AliYmn/66498d8bcadb831b8ef81a471b77fc15#file-env-L5

result error ;

https://hastebin.com/akedebidop.rb

from dockerizing-django.

AliYmn avatar AliYmn commented on September 28, 2024

The problem was solved after it was built.
Thank you so much.

from dockerizing-django.

AliYmn avatar AliYmn commented on September 28, 2024

I'd like to ask you something else if you let me.
I established another site with Docker (port: 8001). But I got a postgres error, why?
Also, I can not build a second new database.

from dockerizing-django.

mjhea0 avatar mjhea0 commented on September 28, 2024

Depends on the error. Sorry, but I cannot offer any more support. GitHub issues is not the right venue for this. Please post your questions on StackOverflow.

I also suggest going through some Docker basics:

Once you get the basics down and you want to learn more about linking multiple services together, check out http://testdriven.io/

from dockerizing-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.