How to edit django-allauth default templates?

后端 未结 8 1833
抹茶落季
抹茶落季 2020-12-15 06:35

i\'m using Django 1.10 and i want to add the allauth\'s app for login, signin, etc, to my website. I\'ve installed allauth from pip, and tried to put the templates from alla

相关标签:
8条回答
  • 2020-12-15 06:59

    Allauth templates can be overridden just like the normal template overriding methods.

    1. Set template directory

    TEMPLATE_DIRS = ( os.path.join(BASE_DIR,'templates'), os.path.join(BASE_DIR,'templates'))

    1. Your template directory will be in project directory. Go inside your template directory and create a directory named allauth, inside allauth create a template directory and inside that create a directory accounts

    2. Create html files with same name as allauth templates. Refer to allauth github repository for more info on template names.

    0 讨论(0)
  • 2020-12-15 07:07

    I use django 3.0.4 with django-allauth 0.41.0

    Add folder templates in your project directory. Inside the folder templates add another folder with the app_name, in the case of the template login.html you'll create a folder accounts

    so the full path will be

     /project_name/templates/accounts/login.html
    

    my TEMPLATE Dirs in settings.py remain the same

    'DIRS': [os.path.join(BASE_DIR, 'templates')]
    

    django-allauth doc templates

    0 讨论(0)
提交回复
热议问题