[BangPypers] Can two django projects be made to communicate to each other

Lakshman Prasad scorpion032 at gmail.com
Wed Dec 1 12:46:48 CET 2010


If I understand what you are saying,

You have 2 different projects in django, (in different repos) and you don't
want to have user logged in, in each site.

The *simplest* way to solve this is to configure the django.contrib.auth of
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.

Details about using multiple databases in projects can be found in the
documentation:
http://docs.djangoproject.com/en/dev/topics/db/multi-db/#defining-your-databases

<http://docs.djangoproject.com/en/dev/topics/db/multi-db/#defining-your-databases>Essentially
you will need to define the routers and for this case, the router is just a
lambda that gives the user database if the app is django.contrib.auth.


On Wed, Dec 1, 2010 at 11:40 AM, Anubha Dadhich <sethi.anubha at gmail.com>wrote:

> Hi,
>
> Can two django projects be made  to communicate with each other and share
> the same session, user_authentication etc., either at the application level
> or at the production server level (say apache)
>
> Explaining it further -
>
> Say there are two django projects, with different settings file, but
> sharing
> the same database, can they be made to run on the same port?
>
> Or else, say one project is running on port aaaa and the other project is
> running on port yyyy, can apache be configured in such a way that the user
> does not come to know about the switch in port when a request is sent from
> the url.
>
> i.e. say there are two requests
>
> i). www.test.com:aaaa/account/login  -- project1
> ii). www.test.com:yyyy/profile -- project2
>
> can there be any configuration setting so that the user does not have to
> provide the port number explicitly to tell apache that the two requests are
> actually to two different projects and can simply  send the request as
>
> i) www.test.com/account/login -- project1
> ii) www.test.com/profile -- project2
>
> Just wanted to confirm if such a setting is possible or not. If yes, then
> plz provide some information on how to achieve this.
>
>
> --
> Anubha Dadhich
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list