문제

I started develop two sites separately, but now I need to merge them (so http://site1.com/site2) points to site2 (which has a separate settings.py).

I could probably refactor the code and make site2 an app of site1, but I suspect there is an easy way. Also, site2 uses a different database, and I don't intend to mix up both databases...

If I want to use subdomain (like site2.site1.com), will it make it easier?

Any suggestion? Thanks.

도움이 되었습니까?

해결책

The easiest way to do this is to leave both Django applications separate but present them as one site using a reverse proxy such as nginx. The applications will live on separate servers or at least be served on the same server on separate ports, and nginx will proxy requests to one application or the other based on what path is requested.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top