Django url.py 重写到不同的主机
Django url.py rewrite to a different host
这是我的 url.py
urlpatterns = patterns('',
url(r'/newm/$', views.CreateManView.as_view(), name='create_man'),
我已将其更改为:
url(r'http://y.y.y.y/newm/$', views.CreateManView.as_view(), name='create_man'),
但导致调用:
我怎样才能更改所有引用 create_man 的 url,以便它们到达
?
查看 django-hosts,它确实如此。
至于将其作为 Django 中的一项功能,核心开发人员评论 this question:
This has been solved by external apps and I'm happy with that solution
这是我的 url.py
urlpatterns = patterns('',
url(r'/newm/$', views.CreateManView.as_view(), name='create_man'),
我已将其更改为:
url(r'http://y.y.y.y/newm/$', views.CreateManView.as_view(), name='create_man'),
但导致调用:
我怎样才能更改所有引用 create_man 的 url,以便它们到达
?
查看 django-hosts,它确实如此。
至于将其作为 Django 中的一项功能,核心开发人员评论 this question:
This has been solved by external apps and I'm happy with that solution