AttributeError: 'DatabaseWrapper' object has no attribute 'set_schema'
I'm using django with mutlitenants using the package django-tenants==3.5.0
When i deployed the app to railway im getting the error.
AttributeError: 'DatabaseWrapper' object has no attribute 'set_schema'
I have also updated the railway environment variables and set my engine to ... ENGINE=django_tenants.postgresql_backend
But I'm not able to fix the error
31 Replies
Project ID:
fd0bd18d-392d-4b0d-af5c-395356468583
fd0bd18d-392d-4b0d-af5c-395356468583
what version of python are you using locally and what version is railway using?
its python 3.10 in local
i dont know if there is any specfic python version in railway
of course there is lol
check the build table at the top of the build logs
![No description](https://cdn.answeroverflow.com/1150129266692993135/image.png)
its python 3.8
have railway uses 3.10 too
https://nixpacks.com/docs/providers/python#setup
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": [
"python"
],
"phases": {
"setup": {
"nixPkgs": [
"...",
"nodejs"
]
}
}
},
"buildCommand": "npm ci"
},
"deploy": {
"startCommand": "pip install -r requirements.txt && python manage.py migrate && python manage.py collectstatic --noinput && gunicorn hospital_site.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
this is my railway.json so how to modify it
please read this section of the docs
https://nixpacks.com/docs/providers/python#setup
NIXPACKS_PYTHON_VERSION 3.10
i just need to add this environment variable ?
![No description](https://cdn.answeroverflow.com/1150130815699783681/image.png)
yep if that's the method you'd like to use
ok let me see this if this would fix the issue hopefully π
im still getting the issue, I think the problem is not related to the python version. Could it be something else
are you using alll the same dependency versions locally and on railway?