執行django專案遇到的問題

2021-10-19 17:40:14 字數 1806 閱讀 9315

建立好django專案,編寫hello world,準備執行檢視,卻報如下錯誤,只需要檢視settings.py檔案,進行如下就該即可。

將 『dirs』: [base_dir / 『templates』], 修改為 『dirs』: [os.path.join(base_dir, 『templates』)],即可。

然後啟動伺服器,又出現如下錯誤

檢視functools.py檔案(雙擊報錯的藍色鏈結),

將截圖上{}內的**替換為如下內容即可

lt』: [(『gt』, lambda self, other: not (self < other or self

== other)),

(『le』, lambda self, other: self < other or self == other),

(『ge』, lambda self, other: not self < other)],

le』: [(『ge』, lambda self, other: not self <= other or self == other),

(『lt』, lambda self, other: self <= other and not self == other),

(『gt』, lambda self, other: not self <= other)],

gt』: [(『lt』, lambda self, other: not (self > other or self == other)),

(『ge』, lambda self, other: self > other or self == other),

(『le』, lambda self, other: not self > other)],

'ge': [(『le』, lambda self, other: (not self >= other) or self == other),

(『gt』, lambda self, other: self >= other and not self == other),

(『lt』, lambda self, other: not self >= other)]

再次啟動伺服器:

正常啟動!!!訪問127.0.0.1:8000/hello/檢視內容

django 專案中遇到的問題

問題1 in include provide the namespace argument to include instead 描述 在最外層的urls.py 新增專案的urls後報錯,錯誤顯示 in include provide the namespace argument to includ...

執行django專案

密碼 資料庫名稱按我給你指定的設定 版本別太高,mysql5.5即可。檢視編碼 show variables like character 最終要把所有的都變成utf 8 修改 etc my.cnf配置檔案 mysqld character set server utf8 init connect ...

Django初學遇到的問題

1.django.utils.internalerror 1049,unknown database community 在使用mysql資料庫前得先建立資料庫 2.django.core.exceptions.improperlyconfigured error loading mysqldb m...