How to edit django-allauth default templates?

后端 未结 8 1847
抹茶落季
抹茶落季 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:45

    Well, i was just able to do it.

    I didn't know where these templates were but i found that, in my case (i'm using virtual env):

    Envs/myproject/Lib/site-packages/allauth/templates
    

    i modified the base.html and added my static folder with all my bootstrap stuff and jquery to the settings in the file:

    app_settings.py
    

    and added this.

    ...
    import os
    
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    
    STATIC_URL = '/static/'
    
    STATICFILES_DIRS = [
        os.path.join(BASE_DIR, "static"),
    ]
    

    And that's all.

    I don't know if this is the propper way to do it but if someone have a better answer please post it.

提交回复
热议问题