overriding default templates of django-allauth

前端 未结 7 1861
小鲜肉
小鲜肉 2020-12-09 02:22

I used this social registration/signup library django allauth for a project of mine. How do i customize the default templates and forms to give a better look and feel?

7条回答
  •  臣服心动
    2020-12-09 03:04

    In your views:

    from allauth.account.views import SignupView, LoginView
    
    
    class MySignupView(SignupView):
        template_name = 'my_signup.html'
    
    
    class MyLoginView(LoginView):
        template_name = 'my_login.html'
    

    Do pay attention to the examples and docs for structuring your own templates.

    Watch this piece in the example templates though:

    I had to remove the URL link to make it work properly in my own template:

    '
    

提交回复
热议问题