Your default router has nothing to deal with the domain. It only generates patterns to be matched after the domain name.
Let's say you have the following default router:
router = routers.DefaultRouter()
router.register('users', views.UserViewSet)
That means /users/
will be matched to some view no matter what the domain is. So for the developement process it will match 127.0.0.1:800/users/
and localhost:8000/users/
. After you deploy it to website.com/
, it will match website.com/users/
In most cases the domain is changed automatically as you deploy it to some platform or server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…