[BangPypers] Can two django projects be made to communicate to each other
scorpion032 at gmail.com
Wed Dec 1 13:29:02 CET 2010
If you have 2 base urls.py, I think correspondingly, you also need 2
settings.py and hence 2 WSGI files.
As far as I know, each Apache virtualhost can only take 1 WSGIProcess. So
you will need 2 apache processes. - I might be wrong on this, and there
might be a better way.
The best way, I can think of to move the request around between projects
(and corresponding apache processes) would be to use nginx as a proxy and
pass the request to an appropriate process.
There are many good tutorials to configure nginx to proxy apache. You should
I wonder why you want to have 2 urls.py and 2 settings.py *within the same
repo*. Sounds counter intuitive to me. Is there a reason you cant refactor
it into the same urls.py with includes like:
urlpatterns = patterns('',
On Wed, Dec 1, 2010 at 5:36 PM, Anubha Dadhich <sethi.anubha at gmail.com>wrote:
> On Wed, Dec 1, 2010 at 5:16 PM, Lakshman Prasad <scorpion032 at gmail.com
> > If I understand what you are saying,
> > You have 2 different projects in django, (in different repos) and you
> > want to have user logged in, in each site.
> They are in the same repository. Yes we do not want user to log in at both
> the places.
> > The *simplest* way to solve this is to configure the django.contrib.auth
> > both the projects to use the same database. - And yes, it is a goddamn
> > database. Any number of separate projects can open connections to it.
> Yes the two projects are sharing the same database.
> > Details about using multiple databases in projects can be found in the
> > documentation:
> > <
> > >Essentially
> > you will need to define the routers and for this case, the router is just
> > lambda that gives the user database if the app is django.contrib.auth.
> The problem is that I do not understand how to make apache redirect
> to their respective projects.
> Say the projects, project1 and project2, have their respective urls.py
> When the url is www.test.com/account/login -- the request should be
> redirected to project1, because only the urls file in the project1 knows
> to resolve it.
> as the url changes to www.test.com/profile -- the request should be
> redirected to project2. (say profile requires user to be authenticated,
> as you and siddharta mentioned that user authentication is taken care by
> django.contrib.auth backend and the two projects are already sharing the
> same database, there should not be any problem in passing the user_context
> between the two projects).
> I need some links which will help me configure apache in the desired way.
> That will help a great deal.
> Thanks all.
> BangPypers mailing list
> BangPypers at python.org
More information about the BangPypers