5👍
✅
IIRC, you need to change the default schema for the user your are connecting as. If you’re using a SQL Auth user called django_user
:
ALTER USER django_user WITH DEFAULT_SCHEMA = [sp]
Good luck.
3👍
Define the db_table under the Meta class of one model as follows:
db_table = "[your_schema].[your_table]"
- [Django]-Python logging decorator for views
- [Django]-How to filter model with a list containing the field and the value?
- [Django]-Using django-taggit, is it possible to limit the tags to pre approved values?
- [Django]-Feature differentiation: Rails / Django
2👍
I’ve found that a number of answers don’t seem to work any more. Instead, I use the instructions found here to set the schema when defining db_table
such as it goes schema].[table
. Don’t open those square brackets; the important bit is the ].[
between schema and table name.
In your case, you’d need to set:
class Meta:
managed = False
db_table = 'sp].[tablename'
- [Django]-MySQL database being hit too many times with django query
- [Django]-What is the best framework/reusable app for caching model instances (object level cache) in Django?
- [Django]-Why is django.test.client.Client not keeping me logged in
Source:stackexchange.com