Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.67K
1 Posted Topic
but i want get request object in routers.py to choice a database and dont can get request object. I need request.META.get('HTTP_HOST') to depend of domain to choice a database from django.http import HttpRequest class DatabaseRouter(object): def db_for_read(self, model, **hints): request = HttpRequest() if request.META.get('HTTP_HOST) == 'domain1': return 'database1' if request.META.get('HTTP_HOST) …
The End.