2016-08-04 34 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

相關問題