'migrate' does not find existing postgres database

9 views
Skip to first unread message

Rich Shepard

unread,
Jun 26, 2017, 4:08:36 PM6/26/17
to django...@googlegroups.com
This is my first django project and is intended for my own use, but I'll
put it on git-hub when it's working.

The database backend is postgresql-9.6.3 and exists in /var/www/htdocs/.
When I run 'python3 manage.py migrate' django looks for the database in
~/development/crm_project/crm/ and does not find it there. In settings.py I
have defined the engine:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.path.join(BASE_DIR, 'crm'),
'USER': 'rshepard',
'PASSWORD': '<redacted>',
'HOST': '',
'PORT': '5432',
}
}

Again, this is for my use and the database with its existing tables lives
in the same cluster with all my other databases. And, each table will be a
separate app; the models have been translated from sql to django.

I'd appreciate suggestions on how to proceed.

Rich

Vijay Khemlani

unread,
Jun 26, 2017, 4:43:08 PM6/26/17
to django...@googlegroups.com
Maybe I'm misunderstanding, but you don't access PostgreSQL databases
as normal files with a path.

If you were using SQlite that might work, but not on typical SQL
databases (MySQL, Postgres, etc)

Rich Shepard

unread,
Jun 26, 2017, 4:58:51 PM6/26/17
to django...@googlegroups.com
On Mon, 26 Jun 2017, Vijay Khemlani wrote:

> Maybe I'm misunderstanding, but you don't access PostgreSQL databases
> as normal files with a path.
>
> If you were using SQlite that might work, but not on typical SQL
> databases (MySQL, Postgres, etc)

Vijay,

That would do it. I took the default settings.py and changed the db name
without noticing that it does not need the default path in the file.

Thanks,

Rich
Reply all
Reply to author
Forward
0 new messages