0
我想知道如果以下是可能的,需要一個例子。在Django中如何創建呈現登錄表單的模板標記?
我想創建一個呈現登錄表單的模板標籤。請這樣做和指導。
背後的原因是我有一個登錄表單,需要在我網站的每個頁面上。我已經決定這會更好,因爲我可以包括一個標籤。我想使用我的forms.py中的表單,而不是對它進行硬編碼。
即
from django import template
from accounts.forms import AuthenticationForm
register = template.Library()
def authentication_form():
render this form == AuthenticationForm() ?????