On 18/08/2011 11:23am, michael kapelko wrote:
I don't think the OP want to select which db is used, but to connect
to the db with the logged in user's credentials.
Exactly.

DB authentication and user authentication are separate things. Users authenticate 
against Django. Full stop. Django>  accesses the database using login data you 
provide on settings.py.
That's why I asked. I want to dynamically modifiy DB settings in
settings.py after user logged in with user credentials.

You could write a callable function to provide different database settings after Django has started but I suspect those settings are cached at startup. Might be a bit tricky to interfere with that.

OTOH if there are only a limited number of DBs you could put them all in settings.py and switch between them based on the collected credentials.


So far I have a Delphi app that asks user for username and password.
After he enters it and hits Enter, the application tries to connect to
the database with the provided credentials. All the permissions are
managed at database levels.
I want to remove Delphi app with Django app, so I need to login to
database with user credentials.

Delphi usually produces PC programs which rely on the Windows eco-system while Django doesn't. Not sure what you are trying to do. Can you describe your system?


Can you point me to the docs that deal with it?

Thanks.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to