【发布时间】:2016-06-07 14:44:39
【问题描述】:
在 Mezzanine 中,您可以使用两个不同的 URL,具体取决于您要显示的内容。有没有办法检查 inside urls.py 活动域是在子域上还是只是“常规”域?
这是两种不同的风格:
url('^$', direct_to_template, {'template': 'index.html'}, name='home'),
url('^$', mezzanine.blog.views.blog_post_list, name='home'),
我还没有找到可靠的方法。如果我在子域(通配符/例如 sub.example.com)上,我想显示 blog_post_list,如果我在“主”域(例如 example.com)上,我想显示 index.html
【问题讨论】: