I have the following database settings in django:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'default_db',
},
'otherdb': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'other_db',
}
}
default model is:
class Notification(models.Model):
otherdb model is:
class Entity(models.Model):
In my view code I simply do:
entities = Entity.objects.get(pk=pk)
for entity in entities:
print entity
According to the django docs, django will do the database routing for you. I have models for both databases. When I run this i get an error that:
1146, "Table 'default_db.Entity' doesn't exist"
It should be looking for other_db.Entity
Is there something I need to do to make the routing occur on my ec2 instance?