Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImproperlyConfigured: Could not locate the 'psqlextra.backend' #225

Open
hitesh-scanova opened this issue Nov 4, 2023 · 1 comment
Open

Comments

@hitesh-scanova
Copy link

hitesh-scanova commented Nov 4, 2023

We are using django-postgres-extra and loading database settings through .env file and default database is sqllite3

DEFAULT_DATABASE = {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}

DATABASES = {
    'default': eval(os.environ.get('DATABASE_MAIN', str(DEFAULT_DATABASE))),
}

The database is passed using environment specific .env file

DATABASE_MAIN{'ENGINE':'psqlextra.backend','NAME':'name','USER':'user','PASSWORD':'password','HOST':'host','PORT':'5432'}

We have setup Github actions to extract translation files. Since, there is no database defined in the actions(CI), the following command gives error -
python src/manage.py makemessages -l en

Error -
django.core.exceptions.ImproperlyConfigured: Could not locate the 'psqlextra.backend'. django-postgres-extra cannot function without the 'psqlextra.backend'. Set DATABASES.ENGINE.

It checks for database settings and do not find psqlextra.backend as DATABASE ENGINE name and throws this error.

Is there any way to skip the checking of database settings during the translation or pass the default database with psqlextra.backend as engine name.

@Photonios
Copy link
Member

Could you perphaps have multiple databases configured? Are you sure the eval is working correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants