2017-03-28 63 views
0

我有一個Django applicationUbuntuApache serverChromeFirefox下工作完美運行,但是當我通過互聯網Explorer 11訪問它,它不會加載。我沒有在瀏覽器窗口中呈現HTML,而是收到IE 11個下載頁面,而不是打開它,工作在Chrome和Firefox

是否要從XXXXXX消息中打開或保存XXXXXX。

嘗試在IE調試現場,與控制檯顯示變暖:

HTML1527:DOCTYPE預期。考慮添加一個有效的HTML5文檔類型: 「」

但是,這是HTML的第一行。

在Chrome中,此錯誤未出現,但我收到有關包含密碼字段的頁面的警告(尚未翻轉爲https,因爲我仍在開發中)。 (調試中)唯一的其他東西是「內容類型」顯示空白,但其他網站我審查有條目(文本/ HTML等),但我不明白如何填充此信息。

請告訴我如何進一步排除故障,找出頁面未加載的原因。

這裏是代碼:在齒輪 菜單

<!DOCTYPE html> 
<html> 
<head> 

<meta content="text/html; charset=UTF-8" http-equiv="content-type"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<title>ops</title> 

<link rel="stylesheet" type="text/css" href="/static/content/bootstrap.min.css" /> 
<link rel="stylesheet" type="text/css" href="/static/content/site.css" /> 
<script src="/static/scripts/modernizr-2.6.2.js"></script> 
</head> 

<body> 
<div class="navbar navbar-inverse navbar-fixed-top opsBlack"> 
    <div class="container"> 

     <div class="navbar-header"> 
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
      </button> 
      <img src="/static/images/test-N.png" width ="40" align="left"/> 
      <a href="/" class="navbar-brand">ops</a> 
     </div> 
     <div class="navbar-collapse collapse opsBlack"> 
      <ul class="nav navbar-nav"> 
       <li><a href=#>Test</a></li> 
       <li><a href=#>Test</a></li> 
       <li><a href=#>Test</a></li> 
       <li><a href="#" class="bluetext">Mar 28, 2017</a></li> 
      </ul> 


<ul class="nav navbar-nav navbar-right"> 
<li><a href="../registration/login.html">Log in</a></li> 
</ul> 
     </div> 
    </div> 
</div> 
<h2></h2> 
<div class="row"> 
<div class="col-md-8"> 
    <section id="loginForm"> 
     <form action="/accounts/login/" method="post" class="form-horizontal"> 
      <input type='hidden' name='csrfmiddlewaretoken' value='deleted' /> 
      <h4>Use your Account to log in.</h4> 
      <hr /> 
      <div class="form-group"> 
       <label for="id_username" class="col-md-2 control-label">User name</label> 
       <div class="col-md-10"> 
        <input type="text" class="form-control" placeholder="Username" required=Yes name="username" /> 
       </div> 
      </div> 
      <div class="form-group"> 
       <label for="id_password" class="col-md-2 control-label">Password</label> 
       <div class="col-md-10"> 
        <input type="password" class="form-control" placeholder="Password" required=Yes name="password"/> 
       </div> 
      </div> 
      <div class="form-group"> 
       <div class="col-md-offset-2 col-md-10"> 
        <input type="hidden" name="next" value="/" /> 
        <input type="submit" value="Log in" class="btn btn-default" /> 
       </div> 
      </div> 

     </form> 
    </section> 
</div> 
</div> 
    <hr/> 
    <footer> 
     <p>&copy; - ops</p> 
    </footer> 
<script src="/static/scripts/jquery-1.10.2.js"></script> 
<script src="/static/scripts/bootstrap.js"></script> 
<script src="/static/scripts/respond.js"></script> 
</body> 
</html> 

回答

0
  1. 點擊工具> Internet選項或Internet選項。
  2. 單擊「高級」選項卡單擊「恢復高級設置」。
  3. 關閉Internet Explorer並重新打開它。
+0

感謝您的建議,但行爲仍然是一樣的......沒有運氣在瀏覽器中打開html。 – Derek

0

發現問題。

在我最初的'主頁'視圖中,我錯誤地將用戶重定向到登錄頁面。

我本來:

return render(request, "registration/login.html", {}, RequestContext(request)) 

這是不正確的,應該是:

return render(request, "registration/login.html") 

這是建立在HTTP標頭的問題,混亂的IE 11

相關問題