Re: Calling different Django sites from the same external application

2007-07-12 Thread David

Thanks for the note. I apologize for not making myself clear. The
single application from which I want to make API calls against two
distinct Django apps is NOT a Django app itself, nor is it even a web
application, so having Apache set the environment up won't help me!

It seems like I can call the relevant configure() method each time I
need to use one of the APIs. Is that the only approach that will work
for this?

On Jul 11, 8:10 am, Robin Becker <[EMAIL PROTECTED]> wrote:
> Hancock, David (DHANCOCK) wrote:
> > We have two Django "projects" with distinct settings files, and we need to
> > be able to make API calls to each of them from the same (separate)
> > long-running application. Using the API of one of them is easy--we've got
> > the DJANGO_SETTINGS_MODULE defined in the environment of the calling
> > process, and it works great. Now we're adding the second project's API
> > calls, and we're getting the settings of the first project.
>
> > Has anyone got an idea for how to have two sets of settings active in the
> > same application at the same time? The one proposed solution (put the second
> > project inside the first one) seems a little too brute-force to me.
>
> > Cheers!
>
> I did exactly this by having two settings files and changing the environment
> section in the apache container that we used to start off each application.
>
> 
>  PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
>  SetHandler python-program
>  SetEnv DJANGO_SETTINGS_MODULE djcode.app.settings
>  PythonHandler django.core.handlers.modpython
>  #PythonDebug On
>  PythonInterpreter app
> 
> 
>  PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
>  SetHandler python-program
>  SetEnv DJANGO_SETTINGS_MODULE djcode.app.test_settings
>  PythonHandler django.core.handlers.modpython
>  #PythonDebug On
>  PythonInterpreter test_app
> 
> --
> Robin Becker


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Calling different Django sites from the same external application

2007-07-11 Thread Robin Becker

Hancock, David (DHANCOCK) wrote:
> We have two Django "projects" with distinct settings files, and we need to
> be able to make API calls to each of them from the same (separate)
> long-running application. Using the API of one of them is easy--we've got
> the DJANGO_SETTINGS_MODULE defined in the environment of the calling
> process, and it works great. Now we're adding the second project's API
> calls, and we're getting the settings of the first project.
> 
> Has anyone got an idea for how to have two sets of settings active in the
> same application at the same time? The one proposed solution (put the second
> project inside the first one) seems a little too brute-force to me.
> 
> Cheers!

I did exactly this by having two settings files and changing the environment 
section in the apache container that we used to start off each application.


 PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
 SetHandler python-program
 SetEnv DJANGO_SETTINGS_MODULE djcode.app.settings
 PythonHandler django.core.handlers.modpython
 #PythonDebug On
 PythonInterpreter app


 PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
 SetHandler python-program
 SetEnv DJANGO_SETTINGS_MODULE djcode.app.test_settings
 PythonHandler django.core.handlers.modpython
 #PythonDebug On
 PythonInterpreter test_app

-- 
Robin Becker

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Calling different Django sites from the same external application

2007-07-11 Thread Hancock, David (DHANCOCK)
We have two Django "projects" with distinct settings files, and we need to
be able to make API calls to each of them from the same (separate)
long-running application. Using the API of one of them is easy--we've got
the DJANGO_SETTINGS_MODULE defined in the environment of the calling
process, and it works great. Now we're adding the second project's API
calls, and we're getting the settings of the first project.

Has anyone got an idea for how to have two sets of settings active in the
same application at the same time? The one proposed solution (put the second
project inside the first one) seems a little too brute-force to me.

Cheers!
-- 
David Hancock | [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---