The quickest way to get account settings working is probably to keep the separate views (password, social, email) now offered by Allauth. However, it might be nicer to integrate these in a single "account settings" view, and probably use AJAX to save these settings.
A single view without AJAX might be problematic, since then we would have to either merge the Allauth-supplied views and form handling somehow, or reimplement them. The alternative is to create a view of our own, which then only needs to generate the forms (for which it can use existing allauth form classes, or we could even generate the forms through ajax calls, but I'm not too fond of that). The handling of these forms could be done by the existing views and ajax requests.
The allauth settings pages automatically switch to AJAX mode when a request has an appropriate header that is automatically added by jquery or xhr. In practice, this means that opening up a settings page and running something like:
will allow testing the ajax requests and see the responses.
From initial testing, it seems that the ajax request will return both the rendered template, as well as an overview of form fields and any errors in them. For the rendered template to be usable, we probably need to modify the template (or its parent accounts/base.hml to not extend any other template and return just the form).
The quickest way to get account settings working is probably to keep the separate views (password, social, email) now offered by Allauth. However, it might be nicer to integrate these in a single "account settings" view, and probably use AJAX to save these settings.
A single view without AJAX might be problematic, since then we would have to either merge the Allauth-supplied views and form handling somehow, or reimplement them. The alternative is to create a view of our own, which then only needs to generate the forms (for which it can use existing allauth form classes, or we could even generate the forms through ajax calls, but I'm not too fond of that). The handling of these forms could be done by the existing views and ajax requests.
The allauth settings pages automatically switch to AJAX mode when a request has an appropriate header that is automatically added by jquery or xhr. In practice, this means that opening up a settings page and running something like:
will allow testing the ajax requests and see the responses.
From initial testing, it seems that the ajax request will return both the rendered template, as well as an overview of form fields and any errors in them. For the rendered template to be usable, we probably need to modify the template (or its parent
accounts/base.hml
to not extend any other template and return just the form).