hi, I had a same problem as you before, and I spent much of time on it, but could not get it goal.
And the DATAVASES in settings.py is loaded when the server running. If you can let the project reload the settings, you may resolve the problem. Or you can use MySQLdb to do it. Sometimes we can use using(db) to choice which connection is needed. but the connections must be defined before your app start. On Thu, Aug 18, 2011 at 2:15 PM, Jirka Vejrazka <[email protected]>wrote: > > I.e. I want to set up database connection after Django app has started > > *when I want it*. > > Is there a way to do it? > > No. At least not easily. Django is a web framework and is expected to > run on a web/application server with a single-user connection to a > target database. That's typical for web applications. > > What you have now it a typical "thick" client, running on end user's > desktop. I am sorry, but there is no easy conversion between those > two. > > Web applicatons typically users and permissions *winthin the > application* rather than *within the database*. Django is tailored to > the former. > > I can't see how you could change Django easily. You could experiment > with creating settings dynamically and closing DB connection just > before user logs in (Django can open it again when it needs it) to use > your "dynamic" DB connection, but you'd have to somehow link your > "dynamic settings" with user sessions and that might be tricky. > > It's often difficult to make a car fly, no matter how good the car is. > > Cheers > > Jirka > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

