The best solution is to put both sites in the same database. Then site2 can simply read site1's database. Indeed, the site2 can include the site1 application programs, making site2 include all of the site1 features.
If, for some reason, you can't get site1 and site2 to share a common database, then site2 must get data from site1 by requesting it through HTTP.
In the site2 application, you use the same urls.py
as site1. The site2 view functions, however, use urllib2
to make HTTP GET and POST requests to site1. Once the site2 view function has the response from site1, it simply returns it.
Your site2 applications can look something like this.
def someSite2View( request ):
site1= urllib2.open( "http://site1/" + request.path )
data= site1.read()
# you have to parse the data to extract the headers
return Response( headers and data )
This is suprisingly workable. This sort of forwarding happens a lot in HTTP pipelines.