[GH-ISSUE #481] Error when change to postgres #293

Closed
opened 2026-02-27 15:58:08 +03:00 by kerem · 1 comment
Owner

Originally created by @anhnvme on GitHub (Dec 23, 2021).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/481

Hello,

I'm tried change backend database to postgres SQL with config

DATABASES = {
    "default": {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'database',
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

but while i'm access to web, i got errror

<h1 style="font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; padding: 0px; margin: 0px; font-weight: normal; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: sans-serif; background-color: rgb(255, 255, 204);">ProgrammingError at /accounts/login/</h1><pre class="exception_value" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; padding: 0px; margin: 10px 0px; font-size: 1.5em; white-space: pre-wrap; font-family: sans-serif; color: rgb(87, 87, 87); background-color: rgb(255, 255, 204);">relation "appsettings_appsettings" does not exist
LINE 1: ...es", "appsettings_appsettings"."description" FROM "appsettin...
                                                             ^
</pre>

Request Method: | GET
-- | --
http://localhost:80/accounts/login/?next=/
3.2.10
ProgrammingError
relation "appsettings_appsettings" does not exist LINE 1: ...es", "appsettings_appsettings"."description" FROM "appsettin...                                                              ^
/srv/webvirtcloud/venv/lib/python3.8/site-packages/django/db/backends/utils.py, line 84, in _execute
/srv/webvirtcloud/venv/bin/python3
3.8.10
['/srv/webvirtcloud',  '/srv/webvirtcloud/venv/bin',  '/usr/lib/python38.zip',  '/usr/lib/python3.8',  '/usr/lib/python3.8/lib-dynload',  '/srv/webvirtcloud/venv/lib/python3.8/site-packages']

And while i'm access to postgres to show tables, it's empty. Look like database not initialized.

root@cloud-webvirtcloud-77ffc949c5-57t75:/# psql -U postgres database
psql (14.1 (Debian 14.1-1.pgdg110+1))
Type "help" for help.

database=# \dt
Did not find any relations.
database=# 

Do i miss something ?

Thanks everybody

Originally created by @anhnvme on GitHub (Dec 23, 2021). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/481 Hello, I'm tried change backend database to postgres SQL with config ``` DATABASES = { "default": { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'database', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'localhost', 'PORT': '5432', } } ``` but while i'm access to web, i got errror ``` <h1 style="font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; padding: 0px; margin: 0px; font-weight: normal; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: sans-serif; background-color: rgb(255, 255, 204);">ProgrammingError at /accounts/login/</h1><pre class="exception_value" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; padding: 0px; margin: 10px 0px; font-size: 1.5em; white-space: pre-wrap; font-family: sans-serif; color: rgb(87, 87, 87); background-color: rgb(255, 255, 204);">relation "appsettings_appsettings" does not exist LINE 1: ...es", "appsettings_appsettings"."description" FROM "appsettin... ^ </pre> Request Method: | GET -- | -- http://localhost:80/accounts/login/?next=/ 3.2.10 ProgrammingError relation "appsettings_appsettings" does not exist LINE 1: ...es", "appsettings_appsettings"."description" FROM "appsettin... ^ /srv/webvirtcloud/venv/lib/python3.8/site-packages/django/db/backends/utils.py, line 84, in _execute /srv/webvirtcloud/venv/bin/python3 3.8.10 ['/srv/webvirtcloud', '/srv/webvirtcloud/venv/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/srv/webvirtcloud/venv/lib/python3.8/site-packages'] ``` And while i'm access to postgres to show tables, it's empty. Look like database not initialized. ``` root@cloud-webvirtcloud-77ffc949c5-57t75:/# psql -U postgres database psql (14.1 (Debian 14.1-1.pgdg110+1)) Type "help" for help. database=# \dt Did not find any relations. database=# ``` Do i miss something ? Thanks everybody
kerem closed this issue 2026-02-27 15:58:09 +03:00
Author
Owner

@anhnvme commented on GitHub (Dec 23, 2021):

Look like, need to re-run again.

python manage.py makemigrations
python manage.py migrate

Ref: https://github.com/retspen/webvirtcloud/wiki/Docker-Installation-&-Update

<!-- gh-comment-id:1000039752 --> @anhnvme commented on GitHub (Dec 23, 2021): Look like, need to re-run again. ``` python manage.py makemigrations python manage.py migrate ``` Ref: https://github.com/retspen/webvirtcloud/wiki/Docker-Installation-&-Update
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#293
No description provided.