[Django]-Referencing multiple Django projects from a single monorepo

1👍

If you want a Django project to access functionality that resides in a different Django project, a client library is an option (as you noted). You could also consider packaging those sets of functionality as re-usable Django apps that you import into each project, or you could abstract them further into re-usable Python modules which get imported into each project. If you’re hoping to use the Django ORM from one Project to access data from a different project, then you might be looking for this SO question: How to make two django projects share the same database

I think with more specifics in your question (such as, for example, function X in Project A you wish you could call from Project B) we might be able to be more specific with guidance.

👤jchung

1👍

I’m not sure I quite understand the case you’re trying to implement here; two things that sound maybe-sort-of like what you’re asking for are:

1) Running Django projects under uWSGI in Emperor mode allows you to serve multiple Django projects from one server simultaneously.

2) Django can be configured to run the same project under multiple domains simultaneously using the Sites framework.

I agree, though, that more detail about what you have and what you’re trying to accomplish with it is probably necessary to give a satisfying answer.

👤nthall

Leave a comment