Frappe customize registration form

Where should I start when I want to change the user registration form on the website?

I have looked into the Web forms but there is nothing about registration.

Hi @Rob_Michiels,

Do you mean the user sign-up form?
If Yes, then It isn’t a part of the web form.

Thank You!

Hi @NCP,

That is exactly what I mean.
If it is not part of the web form.

Where do I customize it?

Hi @Rob_Michiels,

We don’t suggest changing the base code.
So if you want to change/override then set it in the custom app your according.

It’s worked or not I don’t know. We just share the idea to develop it in a custom app.

In the custom app, create a new web page route: In the hooks.py file of your custom app, add a new route for your sign-up form using the frappe.route function.
For example:

from frappe import route

@route('/signup', methods=['GET', 'POST'])
def signup():
    return frappe.render_template('signup.html')

This creates a new route /signup that will render the signup.html template when accessed.

Create a new HTML template: In the templates folder of your custom app, create a new HTML template file called signup.html. In this file, add the HTML code for your sign-up form.

In the same signup route function, add the logic to process the form data when it is submitted.
For example:

from frappe import request

@route('/signup', methods=['GET', 'POST'])
def signup():
    if request.method == 'POST':
        # Get form data from request
        email = request.form.get('email')
        password = request.form.get('password')
        # Do something with form data
        # ...
        # Redirect to success page
        frappe.local.response['type'] = 'redirect'
        frappe.local.response['location'] = '/signup-success'
    else:
        # Render sign-up form
        return frappe.render_template('signup.html')

This code checks if the request method is POST (indicating that the form has been submitted). It then retrieves the form data from the request and processes it as required. Finally, it redirects the user to a success page.

Add custom CSS and JS your according: If required, you can add custom CSS and JS files to style and enhance your sign-up form.
Once you have completed these steps, your custom sign-up form will be available in your custom app.

Hope you understand.

Thank You!