0

我在夹层中有两个免费主题 -solid & moderna取自 - HERE

我只是想HOST_THEMES运行mezzanine. 所以我继续加载我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():

如果我不使用端口设置我的主机,则相等性失败。

因此,在此之后,我将逐步调试正在拾取的模板。 主持人和主题在这里很匹配

并且模板目录也选对了: 从我的目录中选择了坚实的主题

正如您在 <code>rendered_content</code> 中看到的那样,您会发现moderna 总是被渲染,因为它在顶部并且 <code>template_name</code> 是 <code>solid</code> 目录中的模板

我到底做错了什么?

4

1 回答 1

0

Hosts嘿伙计们,我能够通过以下方式解决这个问题- 1. 定制/etc/hosts

制作了两个自定义主机并将它们绑定到我的 IP 和瞧它工作

我不知道为什么这不起作用localhost127.0.0.1

于 2016-08-04T10:20:56.910 回答