Different IPs are for different apps

时间:2018-03-25 20:50:10

标签: django python-3.x

At first, I am learning Python and Django only... So I'm a noobie yet.
I need to build a microservice architecture to I could run each my service on a separate server machine. In the Django I need to create an environment, project and apps. So, can I run these apps after on different servers? If no, how can I make it with Django? Do I need to create a separate project for each service?
P.S. If my question is stupid, pls, explain where am I wrong. I am from Java Spring world where I was need to create just new app for each service.

1 个答案:

答案 0 :(得分:1)

任何一种方法都可行。

如果您的服务共享相同的代码库是有意义的,您可以创建单个项目并为每个服务使用单独的应用程序,并为每个部署使用单独的设置文件。设置文件会在INSTALLED_APPS中列出所需的应用,并包含特定于该服务的设置。

或者,如果您不需要以这种方式耦合服务,那么您当然可以将每个服务都作为自己的项目。