2016-02-26 17 views

回答

2

覆蓋registration應用程序中的原始模板。

  • 創建Django應用程序registration
  • 創建文件夾裏面templatesregistration
  • 創建文件夾registration it.So文件夾內看上去像registration/templates/registration
  • 裏面registration/templates/registration,創建具有相同的名稱HTMLS在registration app.For例如:password_change_form.html。所以它看起來像registration/templates/registration/password_change_form.html。然後檢查
    https://github.com/macropin/django-registration/blob/master/registration/templates/registration/password_change_form.html和複製粘貼到您password_change_form.html。現在就做你想做的。

希望這有助於。

+0

謝謝,我試圖尋找Django的registrataion - 終極版github上,而不是這一個。 –

3

基於itzmeontv的回答是:

registration應用覆蓋原來的模板。

  • 創建文件夾templates您的基本應用程序裏面,如果它不存在
  • 創建裏面的文件夾registration。因此,文件夾看起來像<yourapp>/templates/registration
  • 裏面yourapp/templates/registration,創建具有相同的名稱HTMLS在registration應用。例如:password_change_form.html。所以它看起來像<yourapp>/templates/registration/password_change_form.html

確保您的基本應用程序在INSTALLED_APPS之前的registration之前。

+0

這解決了我的問題。註冊後添加您的應用程序,您的模板將顯示。 – Axwack

+0

這個答案比itzmeontv更正確,因爲Django 1.10的django-admin'startapp'不允許具有與現有Python模塊同名的應用程序。 'CommandError:'registration'與現有Python模塊的名稱衝突,不能用作應用程序名稱。請嘗試其他名稱 –

相關問題