I'm trying to use the oauth2_provider
library which provides a model for AccessToken, which foreign keys into a User model. My User model will actually live in a different database from the OAuth2 token models. I can use a router to direct which DB to use for a particular model, but am I correct in concluding that Django would not support a foreign key to a model in a different DB?
If I still wanted to extend from the AbstractAccessToken
with my User in a different DB, is there any way that Django allows me to populate the user_id
foreign key column at all? Or would I simply need to leave it null
and define and have my custom AccessToken class define its own unconstrained external_user_id
column?