2016-08-04 33 views
0

我在夹层有两个免费主题 - solid & moderna取自 - HERE为什么模板路径不同并且夹层中渲染的内容不同?

我只是想运行mezzanineHOST_THEMES功能。所以,我继续装都在我的INSTALLED_APPS这样的主题 -

INSTALLED_APPS = (
    "moderna", 
    "solid", 
    "django.contrib.admin", 
    "django.contrib.auth", 
    "django.contrib.contenttypes", 
    "django.contrib.redirects", 
    "django.contrib.sessions", 
    "django.contrib.sites", 
    "django.contrib.sitemaps", 
    "django.contrib.staticfiles", 
    "mezzanine.boot", 
    "mezzanine.conf", 
    "mezzanine.core", 
    "mezzanine.generic", 
    "mezzanine.pages", 
    "mezzanine.blog", 
    "mezzanine.forms", 
    "mezzanine.galleries", 
    "mezzanine.twitter", 
    'mezzanine_api', 
    'rest_framework', 
    'rest_framework_swagger', 
    'oauth2_provider', 
    # "mezzanine.accounts", 
    # "mezzanine.mobile", 
) 

在那之后我配置我的代码和0.0.0.0:8000跑。然后我在HOST_THEMES设置了两个主机这样

HOST_THEMES = [("localhost:8000", "solid"), 
       ("192.168.1.130:8000", "moderna")] 

每个人都知道为什么:8000在我,因为这行代码的主机 - Line 25

if host.lower() == domain.lower(): 

如果我不把我与主机平等失败的端口。

所以在此之后,我正在逐步调试模板。 Host and themes match here clearly

而且模板目录也正确选择: solid theme being picked up from my directory

As you can see in the <code>rendered_content</code> you will find moderna being rendered always because its on top and <code>template_name</code> being the template from <code>solid</code> directory

正是我做错了什么?

回答

0

嘿家伙我能够解决这个 - 1.定制Hosts制作在/etc/hosts

做了两个自定义的主机并将其绑定到我的IP,瞧它的工作

我不知道为什么这不适用于localhost127.0.0.1