1

I have a Django app running on Heroku, and I'd like to add a Wordpress blog to it. After some background reading, it seems like the accepted solution for Rails is:

  1. Deploy a separate Heroku Wordpress app solely for your blog
  2. Use rack-reverse-proxy to redirect mydomain.com/blog to myblog.herokuapp.com

However I have not found an equivalent reverse proxy middleware solution for Django. Does one exist? If not, how would I go about rolling my own?

4

1 回答 1

0

您不需要反向代理来进行重定向。只需使用视图。

创建视图:

def blog(request, *args, **kwargs):
    from django.shortcuts import redirect
    return redirect('http://myblog.herokuapp.com')

将视图附加到 urls.py 文件中的 url:

urlpatterns = patterns('',
    url(r'^blog', blog, name='blog_redirect'),
)
于 2013-03-30T06:26:43.463 回答