I'm deploying a wagtail site to Azure App Service with a postgres db. After running migrations, when I navigate to the webpage, I'm receiving the error mentioned in the title and it is originating from SQLite and Django db backends.
I looked at the wagtailcore_sites table in my local postgresdb and saw that the table had a single entry for localhost and port 80. Could someone shed some light on this table and how it gets populated? This seems to be the missing piece for me in understanding why I am getting the error.
edit: including production.py
from .base import *
import os
DEBUG = False
SECRET_KEY = [os.environ["SECRET_KEY"]]
ALLOWED_HOSTS = [os.environ["WEBSITE_HOSTNAME"], os.environ["CUSTOM_DOMAIN"]]
CSRF_TRUSTED_ORIGINS = [
"https://" + os.environ["WEBSITE_HOSTNAME"],
"https://" + os.environ["CUSTOM_DOMAIN"],
]
conn_str = os.environ["AZURE_POSTGRESQL_CONNECTIONSTRING"]
conn_str_params = {
pair.split("=")[0]: pair.split("=")[1] for pair in conn_str.split(" ")
}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": conn_str_params["dbname"],
"USER": conn_str_params["user"],
"PASSWORD": conn_str_params["password"],
"HOST": conn_str_params["host"],
"PORT": conn_str_params["port"],
}
}
try:
from .local import *
except ImportError:
pass