Now I'm stuck...

As you guys pointed to me, I've searched the web for DJANGO_SETTINGS_MODULE
and found that I can use django.conf.settings to set the settings and that
allowed me to use django in standalone scripts.

To be more clear I use:

from django.conf import settings

then in the code somewhrere else:

settings.configure( DATABASE_ENGINE='sqlite3',
DATABASE_NAME=theFullPathOfTheDatabaseFile )


My whole point of using Django was to be able to use its ORM for project
management purposes. I'm trying to write an open source asset/project
manager for animation studios. So, in my design, I'm going to connect one
projects database  (an sqlite3 database file) then in the same session
(without restarting the whole python shell again) I need to connect to
another projects database.

So when I use settings.configure for the second time I get ( I presume the
very famous ):

RuntimeError: Settings already configured.

errors...

So how should I access another database in one session? should I use the
development version of Django which allows multiple databases?

E.Ozgur Yilmaz
Lead Technical Director
www.ozgurfx.com


On Fri, May 14, 2010 at 6:39 PM, Masklinn <[email protected]> wrote:

> On 2010-05-14, at 17:21 , Tom Evans wrote:
> >
> > Alternatively, all django needs to run is the import location of the
> > settings module [2]. Set it in DJANGO_SETTINGS_MODULE, and then you
> > can just write standard python scripts, importing django bits as
> > needed.
> There are also hacks which let you create a "fake" settings module
> programmatically, but that's what they are: hacks.
>
> Unless `django.conf.settings.configure` has been fixed to work
> correctly instead of being completely broken (aka requiring that
> there is a `DJANGO_SETTINGS_MODULE` and that it points to
> an existing `settings` module when the whole point of the
> function is supposedly to *not* need `DJANGO_SETTINGS_MODULE` in
> the first place)
>
> --
> 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]<django-users%[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.

Reply via email to