Please, I’m having issue to modify the allauth forms template. I want to use my custom template for the form. I have edited the template path in the settings.py : ‘DIRS’: [ os.path.join(BASE_DIR, ‘templates’) ]
Inside the templates folder in my project, I have also added the html page i want to use to override the allauth form template, unfortunately, it is still not working…Please kindly assist me with your suggestions. thanks
I think we may need more details here. Please specify the file names of the templates you’re trying to override, and the directory they’re in (relative to BASE_DIR).
You may also want to review the docs at How to override templates | Django documentation | Django to verify that you haven’t overlooked something.
Sorry if I’m confusing you with my question. In my project, i want to use allauth form to handle the social account login, normal login and signup. By the default, allauth provides me with default login form and signup form. These are the two forms that i want to override, so i can replace the allauth form with my custom login and signup html form. i don’t want to use the
I have attached the screenshots . The signup page is not changing to the one i want to use, instead, it is still showing the one from default one from allauth… You can also see the directory where i created the templates/account/signup.html which is the one that i want to use … Thanks for your support.
Side note: In the future, please don’t post images of code, templates, directory lists, etc. Copy paste that text into the body of your message, surrounded by lines of three backtick - ` characters. This means you’ll have a line of ```, then your code (etc), then another line of ```.
From the looks of the snippet it looks like you have this templates
directory in your app directory. My guess from this is that we’re not looking at the parent BASE_DIR directory here. If that’s correct, you need to ensure that your app appears before allauth
in your INSTALLED_APPS
setting. (Templates are searched by the order of INSTALLED_APPS
- the first template matching the requested name is used.)
Thanks for your support. The error has been fixed. after i ensured that my app appears before in the INSTALLED_APPS and i specified the path correctly in BASE_DIR. I was able to override the login and signup form.
However, I’m faced with another challenge. The arrangement of my signup form is not what i want. I want the arrangement to be in this format[ Username, First Name, Last Name, Email , Password and Confirm Password] but the Email field refused to moved below the First Name and Last Name, it is above the two fields. Please what can i do to solve this.
Secondly, after signup , i want user to receive email verification link with token and the email should be verified before the user can be active.(Please i would be glad if you can add code to the solution)
Thirdly, will all the information received through the signup form be added to the database because, I haven’t created class for the database structure in the MODEL due to allauth. I’m wondering how will i be able to modify the information if it doesn’t have a model structure in the database… Thanks once again
Check the docs for information about this.
You’ll want to go through them all, but these pages should get you started toward answering your questions here:
You can check out my Django starter kit (Sidewinder) where I also override sign in/sign up forms for allauth, including field rearrangement: sidewinder/forms.py at master · stribny/sidewinder · GitHub
thanks. i will look into it