D
D
dr sbtn2016-10-15 12:13:39
PostgreSQL
dr sbtn, 2016-10-15 12:13:39

Setting up postgresql in ubuntu for djanga?

I installed postgresql according to this instruction and created a database using it.
https://www.digitalocean.com/community/tutorials/h...
how to correctly write the name of this database (path to it?) in the settings of my project?
that is, when executing this instruction, where will the database file be saved?
the problem is that when I try to do the first makemigrations, the terminal tells me
"database "nameofDB" does not exist"
Tried to find it in /var/lib/postgresql/9.5/main , BUT for no reason ubuntu tells me "This location could not be displayed. You do not have the permissions necessary to view the contents of “main.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xDubas, 2016-10-15
@0xDubas

You don't need access to the database as a file at all. What for then the DBMS is necessary? They could write and read to the file themselves.
Specifically, postgres opens port 5432 by default, so your project must connect to the DBMS at localhost:5432, if the project and the database are on the same host, of course.
You just need to specify the host, port, database name and password in the project config.
An example of what to write in the config is given at the link: djbook.ru/examples/59

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question